@typescript-eslint/ban-tslint-comment#464
@typescript-eslint/ban-tslint-comment#464ScriptedAlchemy wants to merge 13 commits intoweb-infra-dev:mainfrom
Conversation
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Summary of ChangesHello @ScriptedAlchemy, 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 introduces a new linting rule, 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
The implementation of the @typescript-eslint/ban-tslint-comment rule is a solid addition for cleaning up legacy TSLint directives. The core logic for detecting and reporting these comments is correct and follows the existing patterns in the repository. However, the buildFixRange function has some logic issues regarding how it calculates the range for removal, particularly for trailing comments and indentation, which could lead to unintended code merging or messy formatting.
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cde30d2e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Outdated
Show resolved
Hide resolved
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds support for the @typescript-eslint/ban-tslint-comment rule in rslint to detect and auto-fix legacy TSLint directive comments (e.g. // tslint:disable*) during TSLint→ESLint migrations.
Changes:
- Implement new TypeScript rule
ban-tslint-commentwith autofix support. - Register the rule in the global rule registry and add Go rule-tester coverage.
- Enable the ported typescript-eslint test and add/update its rstest snapshot.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/ban-tslint-comment.test.ts.snap | Adds snapshot expectations for the ported ban-tslint-comment rule test. |
| packages/rslint-test-tools/rstest.config.mts | Enables the ban-tslint-comment test suite in rstest includes. |
| internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment_test.go | Adds Go rule-tester cases for valid/invalid directive comment detection + fixes. |
| internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.md | Documents the new rule and provides examples. |
| internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go | Implements detection + fix logic for TSLint directive comments. |
| internal/config/config.go | Registers @typescript-eslint/ban-tslint-comment in the TypeScript plugin rule registry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Outdated
Show resolved
Hide resolved
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Outdated
Show resolved
Hide resolved
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Show resolved
Hide resolved
internal/plugins/typescript/rules/ban_tslint_comment/ban_tslint_comment.go
Outdated
Show resolved
Hide resolved
Avoid deleting adjacent code by trimming only whitespace and handling standalone comments with safe newline removal. Co-authored-by: Cursor <cursoragent@cursor.com>
Use the original comment substring in diagnostics and remove extra quoting so snapshots render cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
Use string concatenation for diagnostics and a tagged switch for newline handling. Co-authored-by: Cursor <cursoragent@cursor.com>
Match the snapshot expectations by using consistent whoa identifiers. Co-authored-by: Cursor <cursoragent@cursor.com>
Removes the leftover fmt import so Go build and lint jobs pass. Co-authored-by: Cursor <cursoragent@cursor.com>
Handle unary plus numeric expressions in starts/ends detection and add regression coverage for +0 and UTF-16 length semantics. Also add a defensive comment range guard and refresh parity snapshots to match current tester output formatting. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat invalid test cases with an explicit output field as output-bearing even when the value is null or empty string. This aligns local and CI behavior for parity snapshots and updates affected snapshots accordingly. Co-authored-by: Cursor <cursoragent@cursor.com>
Apply Prettier formatting to the rule-tester source after the output-presence logic update so CI format checks pass. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore null support for jsxPragma in RuleTester options and cast languageOptions when calling lint so build-time type narrowing does not break existing no-unused-vars parity fixtures. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Implements the
@typescript-eslint/ban-tslint-commentrule to disallow TSLint directive comments (e.g.,// tslint:disable). This helps clean up codebases migrating from TSLint by removing unused directives.Related Links
Checklist
Made with Cursor