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

Command to disable an eslint rule #21

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

DamienCassou
Copy link
Contributor

@DamienCassou DamienCassou commented Mar 14, 2022

I plan to support all ways to disable rules in eslint. Would you be interested?

/CC @orzechowskid

@orzechowskid
Copy link
Owner

I think an interactive function to add /* eslint-ignore */ comments is a very useful idea. but the only code here specific to Flymake is the source of the diagnostics, and those diagnostics are emitted by eslint.

do you think this feature would also be useful to anyone using Flycheck's javascript-eslint and typescript-tslint interfaces, for instance? is it better as a separate minor-mode or part of an existing major-mode? (or maybe the answer to that is "no", and this is the best place for it?)

@DamienCassou
Copy link
Contributor Author

I think that is an excellent idea. I've just created https://github.com/DamienCassou/eslint-disable-rule.

The package will work with flymake-eslint if:

  • you add the :rule-name to the diagnostic data as my PR suggests, or if
  • flymake-eslint-show-rule-name is non-nil in which case a regexp will be used.

I think it makes sense to merge the part of my PR adding (list :rule-name lint-rule) so people deactivating flymake-eslint-show-rule-name will still be able to use flymake-eslint.

What do you think?

Do you want to be my first user? Any feedback?

@orzechowskid
Copy link
Owner

orzechowskid commented Mar 16, 2022

I think it makes sense to merge the part of my PR adding (list :rule-name lint-rule) so people deactivating flymake-eslint-show-rule-name will still be able to use flymake-eslint.

I agree! at your convenience, please reduce the scope of this PR (and add yourself to the list of Contributors at the top of the file if you wish), and I would be happy to merge.

Do you want to be my first user? Any feedback?

at my job I work on a codebase with eslint-comments/require-description enabled. it might be nice to have a eslint-disable-rule-with-comment or something which prompts for a description and appends it (along with the -- delimiter) to the inserted comment. maybe I will open a PR against your library :)

This metadata can be used by other tools (e.g., eslint-disable-rule).
@DamienCassou DamienCassou marked this pull request as ready for review March 16, 2022 07:01
@DamienCassou
Copy link
Contributor Author

please reduce the scope of this PR

done

add yourself to the list of Contributors

I haven't done that as I think the PR is too small to deserve that. Maybe next time :-).

Thank you for your feedback. I have work to do to support flycheck and other disable comments so feel free to contribute with a PR.

@orzechowskid orzechowskid merged commit bfcf282 into orzechowskid:master Mar 18, 2022
@orzechowskid
Copy link
Owner

thanks for contributing!

@DamienCassou DamienCassou deleted the eslint-disable branch March 20, 2022 18:46
@DamienCassou
Copy link
Contributor Author

at my job I work on a codebase with eslint-comments/require-description enabled. it might be nice to have a eslint-disable-rule-with-comment or something which prompts for a description and appends it (along with the -- delimiter) to the inserted comment. maybe I will open a PR against your library :)

I've added this feature now and others. Feel free to give feedback: https://github.com/DamienCassou/eslint-disable-rule.

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

Successfully merging this pull request may close these issues.

2 participants