eslint-disable-next-line [rule] doesn't work
See original GitHub issue❯ eslint -v v3.1.1
What version of ESLint are you using? ❯ eslint -v v3.1.1
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration: package.json:
"eslintConfig": {
"parser": "babel-eslint",
"plugins": [
"react"
],
"extends": [
"airbnb",
"eslint:recommended",
"plugin:react/recommended"
]
},
"babel": {
"presets": [
"es2015-webpack",
"stage-1",
"react"
],
"plugins": [
"transform-class-properties",
"transform-runtime"
]
}
What did you do? Please include the actual source code causing the issue.
componentDidMount(){
mockData = require('./MockData.json');
// eslint-disable-next-line no-did-mount-set-state
this.setState({
hasLoadedData: true,
});
}
![screen shot 2016-07-22 at 1 12 06 pm](https://cloud.githubusercontent.com/assets/95672/17065253/db99fbc0-500e-11e6-97d8-1921afc483de.png)
What did you expect to happen? The rule to be disabled on the next line.
What actually happened? Please include the actual, raw output from ESLint.
![screen shot 2016-07-22 at 1 19 13 pm](https://cloud.githubusercontent.com/assets/95672/17065269/ed3dd3b0-500e-11e6-9af4-194e61da76af.png)
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top 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
To turn off ESLint in the whole file, you can add /* eslint-disable */ in the first line of that file. Alternatively, you...
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 >eslint quick fix to suppress rule for line doesn't work if there's ...
eslint quick fix to suppress rule for line doesn't work if there's comments next to an existing suppressed rule. 1.
Read more >ESLint Warnings Are an Anti-Pattern - DEV Community
ESLint offers three settings for any given rule: error , warn , and off . The error setting will make ESLint fail if...
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 Free
Top 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
You have to specify that this rule is from react plugin, try changing your comment to this:
Working on this.