"scripts" : {
"lint": "lint-staged",
"lint-watch": "npm-watch"
},
"lint-staged": {
"*.js": "eslint"
},
"watch": {
"lint": {
"patterns": "*",
"extensions": "js",
"ignore": "node_modules"
}
},
I have the above code written in package.json. When I run npm run lint-watch, it runs npm run lint three times each time.
I get the following output:
Sterics-MacBook-Pro:$ npm run lint-watch
>lint-watch /Users
> npm-watch
No task specified. Will go through all possible tasks
[lint] [nodemon] 1.11.0
[lint] [lint] [17:06:15] Running tasks for *.js [started]
[lint] [17:06:15] eslint [started]
[lint] [17:06:18] eslint [failed]
[lint] [17:06:18] → 🚫 eslint found some errors. Please fix them and try committing again.
/Users/tools/static.js
36:19 error Unexpected parentheses around single function argument arrow-parens
56:21 error Unexpected parentheses around single function argument arrow-parens
58:19 error Unexpected parentheses around single function argument arrow-parens
✖ 3 problems (3 errors, 0 warnings)
[lint] [17:06:18] Running tasks for *.js [failed]
[lint] [17:06:18] → 🚫 eslint found some errors. Please fix them and try committing again.
/Users/tools/static.js
36:19 error Unexpected parentheses around single function argument arrow-parens
56:21 error Unexpected parentheses around single function argument arrow-parens
58:19 error Unexpected parentheses around single function argument arrow-parens
✖ 3 problems (3 errors, 0 warnings)
[lint] [lint] 🚫 eslint found some errors. Please fix them and try committing again.
/Users/tools/static.js
36:19 error Unexpected parentheses around single function argument arrow-parens
56:21 error Unexpected parentheses around single function argument arrow-parens
58:19 error Unexpected parentheses around single function argument arrow-parens
✖ 3 problems (3 errors, 0 warnings)
[lint] [lint] [nodemon] app crashed - waiting for file changes before starting...
Why is this happening?
Probably because you have 3 files that nom-watch thinks it should be run on. I honestly don't know and don't think this is related to this package. If it is, please feel free to re-open but provide me with a reproducible repository and better issue description so I can help you.