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.

Provide an option to insert eslint-disable(-next)-line for specific rules

See original GitHub issue

The version of ESLint you are using. 5.8.0

The problem you want to solve. I am adopting new rules in a large legacy codebase. It’s difficult to fix all of the errors immediately so I’d like an easy way of disabling existing violations when a new rule is added.

Your take on the correct solution to problem. I would like an option that automatically inserts // eslint-disable-line foo or // eslint-disable-next-line foo comments for a specific rule or rules.

Are you willing to submit a pull request to implement this change? I am.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kevinbarabashcommented, Jul 6, 2019

That’s perfect. The existing json reporter looks like it should do the trick. Thank you.

0reactions
kevinbarabashcommented, Aug 27, 2019

@btucker in terms of writing a tool for adding // eslint-disable-lines? I have some code that works with my company’s internal linter (which wraps eslint). The formatting is a bit different, but it wouldn’t take much to make it work with what the json reporter outputs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turning off eslint rule for a specific line - Stack Overflow
To disable next line: // eslint-disable-next-line no-use-before-define var thing = new Thing();. Or use the single line syntax:
Read more >
How to disable ESLint for some lines, files or folders
Ignore multiple files or folders ... To turn off ESLint in the whole file, you can add /* eslint-disable */ in the first...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
Rules are the core building block of ESLint. A rule validates if your code meets a certain expectation, and what to do if...
Read more >
24. Enable or Disable ESLint rules for a particular file or the ...
In this video, we will see how to enable or disable the ESLint rules for a particular file or the set of lines...
Read more >
User Guide | eslint-plugin-vue
If you want to run eslint from the command line, make sure you include the .vue extension using the --ext option or a...
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