Inline comment option to warn instead of disable
See original GitHub issueThe version of ESLint you are using. 6.8.0
The problem you want to solve.
I have reviewed an eslint error and decided it should be a warning. Currently I do not see a way to override a line to set it to warning at the line level. It looks like currently the only options are either 1) override at the config level / file level, or 2) disable the rule completely on the line using // eslint-disable-line [rule]
Your take on the correct solution to problem.
Add inline comment options for // eslint-warn [rule]
, // eslint-warn-line [rule]
, // eslint-warn-next-line [rule]
Are you willing to submit a pull request to implement this change?
Potentially. Doesn’t seem too difficult if most of the code for eslint-disable
can be leveraged.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
no-inline-comments - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Add Inline Comment feature is notifying watchers of a page
We want it to only notify the person tagged on the Inline Comment, not all watchers. Is there a way to change this?...
Read more >how to support inline comments when using eslint-prettier ...
ESLint & Prettier both Support Inline Comments. The problem isn't the formatter or linter, its your "extends" field, among other issues.
Read more >Warning Options (Using the GNU Compiler Collection (GCC))
(Printing of the option in the warning message can be disabled using the ... The whole body of the C or C++ style...
Read more >Suppress code analysis warnings - .NET - Microsoft Learn
You can disable a rule that's causing a warning by setting its severity to none in an EditorConfig or AnalyzerConfig configuration file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure I understand why you would want to do this - can you explain what problem this solves? We would also need to think about the API, because the relationship between
eslint-enable
andeslint-warn
is not very clear. Also, if someone wanted to enable both rules as errors and rules as warnings, do they have to use two different types of directive comments?Agreed that this should go through the RFC process, but it’s also fine to get some initial feedback here.
I think this needs a RFC as it belongs to the core 🤔