Skip to content

Commit d04d9e3

Browse files
authored
Niu/prettier husky set up (#485)
* test pre commit * add husky pre commit to run prettier * add prettier ignore * test lint pre commit
1 parent 30ec4c4 commit d04d9e3

File tree

5 files changed

+625
-4
lines changed

5 files changed

+625
-4
lines changed

.eslintrc.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
"project": "./tsconfig.json"
55
},
66
"plugins": ["@typescript-eslint"],
7-
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
7+
"extends": [
8+
"next/core-web-vitals",
9+
"plugin:@typescript-eslint/recommended",
10+
"prettier"
11+
],
812
"rules": {
913
"@typescript-eslint/consistent-type-imports": "warn",
10-
// We may turn this back on later
1114
"@typescript-eslint/ban-ts-comment": "warn",
12-
"@next/next/no-img-element": "off"
15+
"@next/next/no-img-element": "off",
16+
"no-unused-vars": "warn",
17+
"@typescript-eslint/no-unused-vars": "warn",
18+
"no-console": "warn"
1319
}
1420
}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package.json
2+
package-lock.json
3+
4+
# distribution
5+
dist/
6+
7+
# build
8+
build/
9+
10+
11+

0 commit comments

Comments
 (0)