Skip to content

Commit

Permalink
feat(husky): add eslint,prettier pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
NetWin committed Oct 11, 2024
1 parent b09021d commit dcfead0
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 2 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
13 changes: 13 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"*.ts": [
"eslint --fix",
"prettier --write"
],
"*.html": [
"eslint --fix",
"prettier --write"
],
"*.scss": [
"prettier --write"
]
}
118 changes: 118 additions & 0 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"npm_pack": "cd dist/picker && npm pack",
"package_windows": "npm run build_lib_onWindows && npm run build_css_onWindows && npm run npm_pack",
"package_linux": "npm run build_lib_onLinux && npm run build_css_onLinux && npm run npm_pack",
"prettier": "prettier --write \"projects/**/*.{ts,html,scss}\" \"src/**/*.{ts,html,scss}\" \"e2e/**/*.{ts,html,scss}\""
"prettier": "prettier --write \"projects/**/*.{ts,html,scss}\" \"src/**/*.{ts,html,scss}\" \"e2e/**/*.{ts,html,scss}\"",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,22 +59,24 @@
"@angular/cli": "^18.2.7",
"@angular/compiler-cli": "^18.2.7",
"@angular/language-service": "^18.2.7",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/jasmine": "^5.1.4",
"@types/jasminewd2": "^2.0.13",
"@types/node": "^22.7.5",
"@stylistic/eslint-plugin": "^2.9.0",
"angular-eslint": "^18.3.1",
"codecov": "^3.8.3",
"codelyzer": "^6.0.2",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.6",
"jasmine-core": "~5.3.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"lint-staged": "^15.2.10",
"ng-packagr": "^18.2.1",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.1.0",
Expand Down

0 comments on commit dcfead0

Please sign in to comment.