Search code examples
javascriptnode.jseslinteslint-config-airbnb

ESLINT infinite loop


So i used eslint pretty normally until I added a specific rule, then eslint seemed to just loop infinite :

> [email protected] pretest /api
> eslint .

this just stay forever. Never ending the process. So i removed that specific rule again, but it didnt fixed the problem.

This is my eslint file at the moment, but even if i change the rules it would still go infinite.

{
    "extends": "airbnb-base/legacy",
    "parserOptions": {
        "ecmaVersion": 2018
    },
    "rules": {
        "global-require" : 0,
        "no-unused-vars" : 0
    },
    "env": {
        "es6": true,
        "node": true
    }
}

this is my rule in the package.json :

"pretest": "eslint .",

Solution

  • Try ignoring node_modules/ folder:

    eslint . --ext .js --ignore-pattern node_modules/
    

    Also, you can ignore specific folders using .eslintignore file in the root of your project:

    .eslintignore

    /dist
    /node_modules