Skip to content
New issue

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

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

Already on GitHub? # to your account

New Feature/Rule: Consistent formatting of multiline eslint-disable descriptions #161

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

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/dprint/dprint-plugin-typescript (I've open the same issue there: dprint/dprint-plugin-typescript#591 )

/*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?

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 an autofixer to word-wrap, line-length rule and manual fixes already take care of that)

An HTML example I just landed on:

<!-- eslint-disable @angular-eslint/template/no-call-expression --
FIXME: I could not fix all of them immediatly. Further refactoring is required.
Data table row actions (clickable, external route, angular route, empty link) -->
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! 🙂

@Samuel-Therrien-Beslogic
Copy link
Author

Samuel-Therrien-Beslogic commented Jul 4, 2024

Hi, can this be reopenned? (CC @MichaelDeBoey @eslint-community , see #164 )

@MichaelDeBoey MichaelDeBoey reopened this Aug 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants