Use lint-staged with Husky to only lint changed files

This commit is contained in:
Alex Gleason
2021-09-15 11:00:50 -05:00
parent dbc20362fd
commit 38bac67b71
3 changed files with 175 additions and 8 deletions

View File

@ -24,7 +24,7 @@
"test": "${npm_execpath} run test:lint && ${npm_execpath} run test:jest",
"test:lint": "${npm_execpath} run test:lint:js && ${npm_execpath} run test:lint:sass",
"test:lint:js": "npx eslint --ext=js . --cache",
"test:lint:sass": "npx stylelint app/styles/**.scss app/styles/**/*.scss",
"test:lint:sass": "npx stylelint app/styles/**/*.scss",
"test:jest": "npx jest --coverage",
"prepare": "husky install"
},
@ -173,6 +173,7 @@
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"lint-staged": ">=10",
"raf": "^3.4.1",
"react-intl-translations-manager": "^5.0.3",
"react-test-renderer": "^16.13.1",
@ -182,5 +183,9 @@
"stylelint-scss": "^3.18.0",
"webpack-dev-server": "^4.1.0",
"yargs": "^16.0.3"
},
"lint-staged": {
"*.js": "eslint --cache",
"app/styles/**/*.scss": "stylelint"
}
}