Skip to content

Commit

Permalink
husky and lint staged
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgill committed Mar 31, 2024
1 parent 6e9323f commit ab7a373
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 19 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged --concurrent false --relative
6 changes: 6 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'{apps,packages,tools}/**/*.{js,ts,jsx,tsx,json,astro,css}': [
files => `nx affected:lint --files=${files.join(',')}`,
files => `nx format:write --files=${files.join(',')}`,
],
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"scripts": {
"format:check": "nx run-many -t format:check",
"lint": "nx run-many -t lint",
"tsc": "nx run-many -t tsc"
"tsc": "nx run-many -t tsc",
"prepare": "husky"
},
"devDependencies": {
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"nx": "18.2.1"
},
"license": "ISC"
Expand Down
Loading

0 comments on commit ab7a373

Please sign in to comment.