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
Formatting rule for disable directive spacing #14878
Comments
I’m not in favor of this. With nearly 300 rules in the core already, I don’t think this rises to the level needed for inclusion. You can always create a custom rule to do this if it’s important to you. |
eslint-plugin-eslint-comments could be a good place for such a rule. |
@TSMMark thanks for opening the issue! I don't think we should add a core rule for this (plugin is a good idea though). My comment #14617 (comment) was about updating the autofix we implemented in #14617 to better handle the leading space if it doesn't end up being too complex. |
I’m 👍 to trying to produce a better autofix |
I'm working on #14617 (comment) |
I'm closing this issue since it isn't likely that the proposed rule will be accepted. Fix for #14617 (comment) is included in the recent ESLint v8.0.0-rc.0 release. @TSMMark thanks for testing new features on your codebase! Please let us know if you encounter any issues with the new version of this autofix. |
Please describe what the rule should do:
warn about (and ideally fix) spacing in eslint-disable and eslint-enable comments.
What category of rule is this? (place an "X" next to just one item)
[ ] Warns about a potential error (problem)
[X] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Bad:
Good:
Why should this rule be included in ESLint (instead of a plugin)?
#14617 introduces fixable disable directives, which have the potential to be formatted with awkward spacing, so @mdjermanovic recommended opening this new issue
Are you willing to submit a pull request to implement this rule?
Potentially
The text was updated successfully, but these errors were encountered: