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-comments/require-description should allow ignoring particular rules #134

Closed
tylerlaprade opened this issue Oct 16, 2023 · 5 comments
Labels

Comments

@tylerlaprade
Copy link

It's very nice that we can ignore categories of eslint directives. I would find it very helpful to also be able to ignore particular ESLint rules that we disable for self-evident reasons, such as importing a forbidden library is only allowed in our ui-component folder.

(cloned from mysticatea#76)

@mcongrove
Copy link

Ran into this need in my codebase; we have a variable we use throughout the app which causes a render-loop if we add it as a React hook dependency, so we ended up with quite a few eslint-disable-next-line react-hooks/exhaustive-deps. Having to add the same comment over and over in this case would be unnecessary, as everyone using the codebase understands why the rule is being disabled.

I've popped up a PR for this.

@tylerlaprade
Copy link
Author

Thank you very much for the PR, @mcongrove! It sounds like your use case would be better served by a variable-name exclusion for that particular rule, though, so that the rule would still work on other variables.

@mcongrove
Copy link

It sounds like your use case would be better served by a variable-name exclusion for that particular rule, though, so that the rule would still work on other variables.

I over-simplified a bit for the example; it's actually quite a few variables. It's probably indicative of a bigger issue in the libraries we choose and how we utilize hooks, but I'm just in charge of linting rules :)

@github-actions github-actions bot added the Stale label Jan 7, 2024
Copy link

This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that aren't actionable. Please reach out if you have more information for us! 🙂

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
@fregante
Copy link

fregante commented Mar 6, 2024

everyone using the codebase understands why the rule is being disabled

Do they? Developer memory is limited. At some point someone new will see the code and they won't have any context. Comments outlive developers.

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

No branches or pull requests

3 participants