Skip to content

Commit

Permalink
build: run linter on changed files in pre-commit hook (#815)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlj95 authored Nov 11, 2024
1 parent ffaab27 commit e6f79f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"*": "pnpm run format"
"!*.{html,ts,mts,json}": ["pnpm run format"],
"**/*.{html,ts,mts,json}": ["pnpm run lint:code:raw", "pnpm run format"],
".github/**/*.y?(a)ml": ["pnpm run lint:gh-actions"]
}
7 changes: 1 addition & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,7 @@
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.{html,ts,json}",
"cypress/**/*.{ts,json}",
"scripts/**/*.{mts,ts,json}",
"*.json"
],
"lintFilePatterns": ["."],
"maxWarnings": 0
}
}
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
"format:check-all": "pnpm run format-check .",
"git-hooks": "husky",
"lighthouseci": "lhci autorun",
"lint": "pnpm run '/^lint:.*/'",
"lint:code": "ng lint --max-warnings 0",
"lint": "pnpm run '/^lint:[\\w-]*$/'",
"lint:code": "pnpm run lint:code:raw .",
"lint:code:raw": "eslint --max-warnings 0",
"lint:code:raw//": "☝️ lint-staged can't/shouldn't use 'ng lint'",
"lint:commit-message": "pnpm run commitlint:edit-msg",
"lint:gh-actions": "actionlint || true",
"prebuild:font-subsets": "tsm scripts/src/generate-font-subsets.ts",
Expand Down

0 comments on commit e6f79f7

Please sign in to comment.