question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline comment option to warn instead of disable

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kaicataldocommented, May 7, 2020

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 and eslint-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.

1reaction
anikethsahacommented, May 7, 2020

I think this needs a RFC as it belongs to the core 🤔

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found