Skip to content

feat: support rslint-disable prefix for inline directive comments#570

Merged
chenjiahan merged 1 commit intomainfrom
feat/support-rslint-disable-prefix-20260326
Mar 26, 2026
Merged

feat: support rslint-disable prefix for inline directive comments#570
chenjiahan merged 1 commit intomainfrom
feat/support-rslint-disable-prefix-20260326

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

Summary

  • Support rslint-disable, rslint-enable, rslint-disable-line, and rslint-disable-next-line comment directives alongside the existing eslint-* variants. Both prefixes are fully equivalent and can be mixed freely (e.g. rslint-disable paired with eslint-enable).
  • Refactor directive parsing: introduce directivePrefix struct, directiveKind enum, and extract matchDirective() function — eliminates all magic numbers and makes the code more extensible.
  • LSP quick-fix actions now generate rslint-disable comments instead of eslint-disable.

Related Links

  • Docs: website/docs/en/guide/inline-directives.md updated with rslint- as the primary prefix.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Support `rslint-disable`, `rslint-enable`, `rslint-disable-line`, and
`rslint-disable-next-line` comment directives alongside the existing
`eslint-*` variants. Both prefixes are fully equivalent and can be
mixed freely.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 Rslint's inline directive capabilities by introducing a new rslint- prefix for disabling and enabling rules, aligning the tool's branding while maintaining full compatibility with existing eslint- directives. The underlying parsing mechanism has been significantly refactored for improved maintainability and future expansion, and the LSP integration has been updated to reflect the new primary prefix.

Highlights

  • New Directive Prefix Support: Introduced support for rslint-disable, rslint-enable, rslint-disable-line, and rslint-disable-next-line comment directives, alongside the existing eslint-* variants. Both prefixes are fully equivalent and can be mixed.
  • Refactored Directive Parsing: The internal directive parsing logic was refactored with new directivePrefix struct, directiveKind enum, and a matchDirective() function, improving extensibility and readability.
  • LSP Quick-Fix Update: LSP quick-fix actions now generate rslint-disable comments by default instead of eslint-disable.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for rslint- prefixed inline directives (e.g., rslint-disable, rslint-enable, rslint-disable-line, rslint-disable-next-line) in addition to the existing eslint- prefixes. This change involves refactoring the DisableManager to handle both prefixes, updating the LSP service to generate rslint- directives, and updating documentation and tests across various components. A review comment highlights an issue where the parseRuleNames function in disable_manager.go deviates from ESLint's behavior by not correctly parsing space-separated rule names, which needs to be addressed to maintain alignment with ESLint's semantics.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rslint with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99370ae
Status: ✅  Deploy successful!
Preview URL: https://a39c74ec.rslint.pages.dev
Branch Preview URL: https://feat-support-rslint-disable.rslint.pages.dev

View logs

@chenjiahan chenjiahan merged commit b8e60b7 into main Mar 26, 2026
20 of 22 checks passed
@chenjiahan chenjiahan deleted the feat/support-rslint-disable-prefix-20260326 branch March 26, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants