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.

Eslint tells me that I have fixable issues, refuses to fix them, ignores `--fix`

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
Slapboxcommented, Feb 23, 2018

Great info! I’ll play with it again soon and see what I can get. Thanks very much!

1reaction
not-an-aardvarkcommented, Feb 23, 2018

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 a fix 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.)

Read more comments on GitHub >

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

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