Skip to content

Commit

Permalink
chore: add nano-staged to fix all linting issues in staged changed
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Nov 27, 2021
1 parent c46f8d1 commit 3239293
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
. "$(dirname "$0")/_/husky.sh"

npm run check && \
npm run lint && \
npm run nano-staged && \
npm run ts -- --noEmit
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"postinstall": "if [ \"$CI\" != 'true' ]; then npm dedupe; fi",
"lint": "eslint src --ext .js,.ts",
"lint:build": "npm run lint -- --config .build.eslintrc.json",
"nano-staged": "nano-staged",
"prepare": "if [ \"$CI\" != 'true' ]; then npm x -- husky install; fi",
"prepublishOnly": "npm run lint:build && npm run build",
"serve": "npm x -y @web/dev-server@latest -- wds --node-resolve -dw -p 3000 -a index.html",
Expand Down Expand Up @@ -132,6 +133,7 @@
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-regexp": "^1.5.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"nano-staged": "^0.3.1",
"typescript": "^4.5.2"
},
"engines": {
Expand All @@ -140,5 +142,8 @@
},
"publishConfig": {
"access": "public"
},
"nano-staged": {
"*.ts": "npm run lint:build -- --fix"
}
}

0 comments on commit 3239293

Please sign in to comment.