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

Make starting-strings like global or eslint configurable #4

Closed
DerZyklop opened this issue Oct 27, 2022 · 4 comments
Closed

Make starting-strings like global or eslint configurable #4

DerZyklop opened this issue Oct 27, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@DerZyklop
Copy link

I tried another package but it has this issue:
cartant/eslint-plugin-etc#48

I can not enable it - it would warn about comments starting with TODO:, which it shouldn’t.

The same issue applies to this eslint-plugin-no-comments.
Since eslint-plugin-no-comments already ignored comments with specific 'starting strings' like global and eslint, it would be solved it these strings could be configured. This would also be helpful if people use other linters etc. to ignore comments like e.g.

// cSpell:ignore Lorem Ipsum

A solution could look like this:

{
  "plugins": ["no-comments"],
  "rules": {
    "no-comments/disallowComments": ["error", {
      "ignore": ["eslint", "global", "cSpell", "TODO:", "BUG:", "HOTFIX:"]
     }]
  }
}
@wisniewski94 wisniewski94 added the enhancement New feature or request label Oct 28, 2022
@wisniewski94
Copy link
Owner

wisniewski94 commented Oct 28, 2022

@DerZyklop Feature added, please check :)

@DerZyklop
Copy link
Author

Works like a charm!

@DerZyklop
Copy link
Author

…and btw. I was able to allow all JSDoc comments with that:
"allow": [ "\\*\n", "\\*\\s" ],

@wisniewski94
Copy link
Owner

@DerZyklop, good point, basically you can add any kind of regex. I will add this information in the future to docs. Thanks for the feedback :)

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

No branches or pull requests

2 participants