-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
no-warning-comments does not work with multiline comments #9884
Comments
Thank you for the report. I confirmed it. If I remove the It's very common putting |
I think we should consider augmenting ast-utils (or creating a new util) which will get the "effective comment text" for a comment and take into account some common patterns, such as JSDoc or just leading |
Is this still something that needs to be worked on, @platinumazure @mysticatea ? |
Hi @sstern6, I think so. Would you like to take a crack at this? |
Sure! Though, where does this stand according to your comment with @mysticatea ? Re:
Should we still go with this approach? @platinumazure Thanks |
Go with any approach you like that fixes the issue. 😄 |
Lol sounds good, should the user be able to put an unlimited about of |
Have a few notes/questions: Context appreciated..... Looks like we can use https://github.com/eslint/eslint/blob/master/lib/rules/no-warning-comments.js#L114 and inspect the node for the first and last chars of the comment. Then if the last and first element of the string are eql to The regex on line https://github.com/eslint/eslint/blob/master/lib/rules/no-warning-comments.js#L80 needs to also be updated for any content thats location is Though this solution fixes the example above, it doesnt account for if a user were too:
How many Also the implementation described above fixes this example(though you should use
@platinumazure @mysticatea what are your thoughts on this approach? I could also see how we could update the Thank you |
@sstern6 That approach sounds promising-- I'm okay with doing a first step now and trying to improve on it later. What I was originally thinking long-term was, it would be nice if we had a way of getting comment text starting from the first word character (or something like that-- and would be nice to handle Unicode properly), and then Instead of trying to add something to ast-utils, though, let's see how far we can get making that sort of change in |
Sounds great @platinumazure. Ill submit a PR shortly, should we make a ticket for the new approach? |
I'm going to report using the online demo rather than my own project, so that anyone else can reproduce this bug as well. It happens in the online demo. https://eslint.org/demo
Direct link to the demo
What parser (default, Babel-ESLint, etc.) are you using?
Default (unless the online demo uses something else?)
Please show your full configuration:
I checked
no-warning-comments
in the demo and downloaded the JSON file.Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Run it in the online demo.
What did you expect to happen?
The sections
and
should be flagged for
no-warning-comments
.What actually happened? Please include the actual, raw output from ESLint.
Only
is flagged for
no-warning-comments
.The text was updated successfully, but these errors were encountered: