Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@eslint-community/eslint-comments/no-unused-disable option to disable autofix #234

Open
Samuel-Therrien-Beslogic opened this issue Jun 17, 2024 · 4 comments

Comments

@Samuel-Therrien-Beslogic
Copy link

Samuel-Therrien-Beslogic commented Jun 17, 2024

Normally to disable a rule's autofix through configuration, I'd simply use https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix . But due to the special way this rule works (as mentionned in its documentation https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html#known-limitations ), no-autofix/@eslint-community/eslint-comments/no-unused-disable doesn't work.

I want to be warned about rules that no longer trigger, but I don't want that change to be automated.

@voxpelli
Copy link
Member

Ideally this would be handled at the ESLint level rather than within any specific rule. That's a bigger task though and not one that excludes this.

@Samuel-Therrien-Beslogic
Copy link
Author

Samuel-Therrien-Beslogic commented Jul 4, 2024

Ideally this would be handled at the ESLint level rather than within any specific rule.

Agreed.

As a note for anyone else reading this, ESLint has https://eslint.org/docs/v8.x/use/configure/rules#report-unused-eslint-disable-comments , but that has a few issues that don't obsolete @eslint-community/eslint-comments/no-unused-disable:

  1. Cannot be configured as warning in v8 through configurations (only through CLI, v9 has https://eslint.org/docs/latest/use/configure/rules#report-unused-eslint-disable-comments )
  2. Doesn't seem to be picked up by extending configurations
  3. Cannot be configured to be autofixed or not (either through configs or CLI). Well, neither can @eslint-community/eslint-comments/no-unused-disable at the moment, but that's what this request is about.

@voxpelli
Copy link
Member

voxpelli commented Jul 4, 2024

I meant that the option to disable autofix for any individual rule should be supported by ESLint, as eg. Biome does: https://biomejs.dev/linter/#configure-the-rule-fix :)

@Samuel-Therrien-Beslogic
Copy link
Author

Ah yes, that too !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants