Skip to content

Commit

Permalink
configure husky to format and lint code on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
antoKeinanen committed Mar 9, 2024
1 parent 04186b3 commit d0b01af
Show file tree
Hide file tree
Showing 6 changed files with 1,477 additions and 2,829 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
public
build
dist
src-tauri
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run pre-commit
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"src/**/*.+(js|json|ts|tsx)": ["eslint"],
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write"]
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
public
build
dist
src-tauri
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"preview": "vite preview",
"tauri": "tauri",
"lint": "tsc --noEmit && eslint --ext .ts,.tsx,.js,.jsx src",
"format": "prettier --write src"
"format": "prettier --write src",
"prepare": "husky install",
"pre-commit": "lint-staged"
},
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -45,6 +47,8 @@
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.0",
"lint-staged": "^15.2.2",
"postcss": "^8.4.35",
"postcss-nesting": "^12.0.4",
"prettier": "^3.2.5",
Expand Down
Loading

0 comments on commit d0b01af

Please sign in to comment.