Skip to content

Commit

Permalink
build(precommit): Introduce lint-staged to only lint staged files in …
Browse files Browse the repository at this point in the history
…the precommit
  • Loading branch information
ryanoglesby08 committed Feb 5, 2018
1 parent 6aeb188 commit b790cc1
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 6 deletions.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"gitbook": "gitbook serve guide",
"gitbook:install": "gitbook install guide",
"lint:js":
"eslint src config docs scripts --ext '.js,.jsx' --config config/.eslintrc.json --fix",
"eslint src config docs scripts --ext '.js,.jsx' --config config/.eslintrc.json --max-warnings 0 --fix",
"lint:scss": "stylelint 'src/components/**/*.scss' --config config/.stylelintrc.json",
"lint:ec": "echint",
"lint": "yarn lint:js && yarn lint:scss && yarn lint:ec",
"packup": "yarn build-package && yarn pack",
"precommit": "yarn lint && yarn pretty-quick && yarn test",
"precommit": "pretty-quick --staged && lint-staged && yarn test",
"prepush": "yarn test && yarn build-package && yarn build-styleguide",
"release:changelog": "changelog",
"release": "scripts/release.sh",
Expand Down Expand Up @@ -83,6 +83,7 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^21.2.1",
"jest-enzyme": "^4.0.1",
"lint-staged": "^6.1.0",
"node-sass": "^4.5.3",
"postcss": "^6.0.7",
"postcss-cli": "^4.1.0",
Expand Down Expand Up @@ -132,6 +133,11 @@
"trailingComma": "es5",
"bracketSpacing": true
},
"lint-staged": {
"*.{js,jsx}": ["eslint --config config/.eslintrc.json --max-warnings 0 --fix", "git add"],
"*.scss": "stylelint --config config/.stylelintrc.json",
"*": "echint"
},
"echint": {
"ignore": [
"**/node_modules/**",
Expand Down
Loading

0 comments on commit b790cc1

Please sign in to comment.