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

Feature Request: Consistent formatting of multiline eslint-disable descriptions #591

Open
Samuel-Therrien-Beslogic opened this issue Dec 20, 2023 · 0 comments

Comments

@Samuel-Therrien-Beslogic
Copy link

Samuel-Therrien-Beslogic commented Dec 20, 2023

See the following multiline comment. There are no rule that I know of which can enforce consistent formatting for it. Neither https://eslint.org/docs/latest/rules/multiline-comment-style , nor https://github.com/eslint-community/eslint-plugin-eslint-comments (I've open the same issue there: eslint-community/eslint-plugin-eslint-comments#161 )

/*eslint-disable-next-line some-linter/some-very-long-rule-name -- This
  disable requires an explanation that can easily be made so consise that
    it would fit under a limit of 80 chars. Triggering eslint(max-len) in the
process*/

This leads to eslint-disable-next-line multiline comment that can vary wildly in style and format.
Some things to consider:

  • Spacing around start/end markers
  • indentation of newlines
  • Whether comment should start on the second line
  • Newline after start marker / before end marker?

I feel like this could safely be taken care of by a formatter.

Atm, with manual formatting, I try to aim for a concise but consistent

/* eslint-disable-next-line some-linter/some-very-long-rule-name --
This disable requires an explanation that can easily be made so consise
that it would fit under a limit of 80 chars. Triggering eslint(max-len) in
the process */

(I don't expect dprint to word-wrap, a line-length linter rule and manual fixes already take care of that)

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

1 participant