Eslint tells me that I have fixable issues, refuses to fix them, ignores `--fix`
See original GitHub issueHey there,
I’m invoking eslint like so node_modules/.bin/eslint --fix src
.
Here’s the output:
*snip*
✖ 27 problems (22 errors, 5 warnings)
8 errors, 0 warnings potentially fixable with the `--fix` option.
And my .eslintrc:
{
"extends": [
"plugin:flowtype/recommended",
"plugin:react/recommended",
"plugin:jest/recommended"
],
"parser": "babel-eslint",
"plugins": [
"flowtype",
"jest",
"react"
],
"rules": {
"react/jsx-no-bind": "warn",
"react/jsx-boolean-value": [
"error",
"never"
],
"react/jsx-closing-bracket-location": "error",
"react/jsx-closing-tag-location": "error",
"react/jsx-equals-spacing": [
"error",
"never"
],
"react/jsx-first-prop-new-line": [
"error",
"multiline-multiprop"
],
"react/jsx-tag-spacing": [
"error",
{
"beforeSelfClosing": "never",
"beforeClosing": "never"
}
],
"react/jsx-pascal-case": "error",
"strict": "off",
"class-methods-use-this": [
"error",
{
"exceptMethods": [
"render",
"getInitialState",
"getDef --aultProps",
"componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
]
}
]
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
},
"import/resolver": {
"node": {
"moduleDirectory": [
"node_modules",
"src/"
]
}
}
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
javascript - --fix doesn't fix the errors using eslint - Stack Overflow
To use --fix option, you need to run eslint directly. Try this ./node_modules/.bin/eslint src --fix. On Windows: .\node_modules\.bin\eslint ...
Read more >ESLint not working in VSCode? Help build a troubleshooting ...
Sometimes it helps to restart VSCode and I've even had problems that ... Did you make sure, ESLint is linting the correct file...
Read more >Command Line Interface - 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 >ESLint | WebStorm Documentation - JetBrains
To open the Problems tool window, click the Inspections widget in the upper-right corner of the editor. ... Alternatively select View | Tool ......
Read more >How To Lint and Format Code with ESLint in Visual Studio Code
You can use a linter to do this. Linters check your code for syntax errors and highlight errors to make sure you can...
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
Great info! I’ll play with it again soon and see what I can get. Thanks very much!
You could use the
--format json
flag to get a JSON representation of the list of problems, and with that you could check which problems have afix
property. (However, this would be even more verbose than--debug
, so I would recommend parsing it and querying it from the Node REPL or something.)