fix: align rule implementations with typescript-eslint#502
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the rslint TypeScript plugin by updating and improving three key rules to maintain better compatibility with typescript-eslint. These changes include bug fixes, new features, and improved documentation, ensuring more accurate and customizable linting for TypeScript code. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves three linting rules (no-invalid-void-type, consistent-type-definitions, and only-throw-error) to better align with their typescript-eslint counterparts. The changes are substantial and well-implemented, including new rule options, robust autofixing capabilities, and more precise type checking logic. The Go implementation is well-structured, and the accompanying test suites have been impressively expanded to cover a wide range of edge cases. I've identified one minor issue in the autofix logic for consistent-type-definitions where single-line comments may not be preserved, but overall this is an excellent contribution.
Note: Security Review did not run due to the size of the PR.
internal/plugins/typescript/rules/consistent_type_definitions/consistent_type_definitions.go
Show resolved
Hide resolved
ff9a89a to
861a118
Compare
…row-error and ban-ts-comment with typescript-eslint - no-invalid-void-type: fix false positives for void in generic type arguments, default type parameters, and heritage clauses (extends/implements); add overload signature detection; support allowAsThisParameter and whitelist options - consistent-type-definitions: add autofix for type/interface conversion; fix missing detection for index signature types; fix isInDeclareGlobal to check for declare keyword modifier - only-throw-error: add allowRethrowing option support; add type specifier matching utility - ban-ts-comment: fix description length calculation to include colon/dash separators per original typescript-eslint behavior; fix message ID for too-short descriptions - Add comprehensive Go and JS tests for all rules - Update rule documentation
861a118 to
80252ae
Compare
Summary
voidin generic type arguments, default type parameters, and heritage clauses (extends/implements). Add overload signature detection (hasOverloadSignatures). SupportallowAsThisParameterand whitelist-basedallowInGenericTypeArgumentsoptions.type↔interfaceconversion, handlingexport,declare, type parameters,extends→intersection,export default interfacesplitting, and parenthesized types. Fix missing detection for index signature types. FixisInDeclareGlobalto properly check fordeclarekeyword modifier.allowRethrowingoption support. AddtypeMatchesSpecifierutility for type specifier matching.Related Links
Checklist