Lint staged not working, no error, no warning
See original GitHub issueI followed this example https://github.com/okonet/lint-staged#installation-and-setup
Have this in my package.json
"scripts": {
"pre-commit": "lint-staged"
},
and added this to my .lintstagedrc
file
{
"*.css": "stylelint",
"*.scss": "stylelint --syntax=scss"
}
Latest OSX, Node version v6.10.0
and npm version 3.10.10
I had stylelint installed already and my stylelint works fine if I run via my grunt task. grunt stylelint
I made a change to my existing .scss
file but don’t get anything in CLI when I add files to staging and commit. Things just work like there is no lint-staged.
Edited
I followed this article https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8
// package.json
...
"scripts" {
"lint-staged": "lint-staged",
"stylelint-staged": "stylelint --syntax scss"
},
"lint-staged": {
"*.js": "eslint",
"*.scss": "stylelint-staged"
},
"pre-commit": "lint-staged"
...
and it worked but I get this warning too after linting errors
pre-commit:
pre-commit: We've failed to pass the specified git pre-commit hooks as the `lint-staged`
pre-commit: hook returned an exit code (1). If you're feeling adventurous you can
pre-commit: skip the git pre-commit hooks by adding the following flags to your commit:
pre-commit:
pre-commit: git commit -n (or --no-verify)
pre-commit:
pre-commit: This is ill-advised since the commit is broken.
pre-commit:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:22 (5 by maintainers)
Top Results From Across the Web
lint-staged not running on precommit - Stack Overflow
The problem for me was I ran "npx mrm lint-staged" like the official website says but it only set the husky and lint-staged...
Read more >lint-staged - npm
Linter commands work on a subset of all staged files, defined by a glob pattern. lint-staged uses micromatch for matching files with the ......
Read more >Lint Staged With Husky for Pre-commit Validations - YouTube
Learn how to use lint staged with husky to implement linting and formatting your code with Prettier and Eslint on pre-commit.
Read more >Husky + Lint-Staged on a React TypeScript Project
Using the ESLint auto-fix and Lint-Staged: problem solved! · “src/**/*.{js,ts,jsx,tsx}” tells that lint-staged will run some action just over the ...
Read more >using ESLint in lint-staged is preventing me from checking in ...
the balloon show no errors only warnings. My peers using VSCode do not have any issues so I assume this is a Webstorm...
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
I ran
rm -rf node_modules
andnpm install
again. after deleting.git/hooks/pre-commit
file and setup everything again from here https://github.com/okonet/lint-staged#installation-and-setupNow I’m back to this error again https://github.com/okonet/lint-staged/issues/165#issuecomment-301003092
i ran
npm ci
because I couldn’t get lint-staged to work either. On re-install i saw a message in terminal:So i ran
git --version
. I am on 2.9. So I updated git to 2.23 and rannpm ci
again with a successful install.now when I try to commit files my lint-staged hook runs and I see errors as expected.