chore(husky): implement husky commit hooks to install, lint and format before commit
This commit is contained in:
parent
54fd97b5ec
commit
e52edaa552
|
@ -1,15 +1,8 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
"simple-import-sort",
|
||||
"unused-imports"
|
||||
],
|
||||
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
|
||||
"plugins": ["@typescript-eslint/eslint-plugin", "simple-import-sort", "unused-imports"],
|
||||
"rules": {
|
||||
// TypeScript ESLint
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
|
@ -35,12 +28,10 @@
|
|||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.js"
|
||||
],
|
||||
"files": ["*.js"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
pnpm install
|
||||
pnpm run lint
|
||||
pnpm run format
|
|
@ -0,0 +1,4 @@
|
|||
dist
|
||||
.next
|
||||
__ENV.js
|
||||
node_modules
|
|
@ -12,8 +12,5 @@
|
|||
"i18n-ally.localesPaths": ["client/public/locales"],
|
||||
"i18n-ally.namespace": true,
|
||||
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
|
||||
"i18n-ally.sortKeys": true,
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "vscode.json-language-features"
|
||||
}
|
||||
"i18n-ally.sortKeys": true
|
||||
}
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
{
|
||||
"extends": [
|
||||
"../.eslintrc.json",
|
||||
"next/core-web-vitals"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
".next",
|
||||
"__ENV.js"
|
||||
],
|
||||
"extends": ["../.eslintrc.json", "next/core-web-vitals"],
|
||||
"ignorePatterns": [".next", "__ENV.js"],
|
||||
"rules": {
|
||||
"@next/next/no-img-element": "off",
|
||||
"@next/next/no-sync-scripts": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"lint": "eslint --fix --ext .js,.ts,.tsx .",
|
||||
"format": "prettier --write \"./**/*.{js,ts,tsx,json}\"",
|
||||
"dev:schema": "pnpm -F schema dev",
|
||||
"dev:server": "pnpm -F server start:dev",
|
||||
"dev:client": "pnpm -F client dev",
|
||||
|
@ -40,6 +43,7 @@
|
|||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"husky": "^7.0.4",
|
||||
"prettier": "^2.5.1",
|
||||
"typescript": "^4.5.5"
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ importers:
|
|||
eslint-plugin-prettier: ^4.0.0
|
||||
eslint-plugin-simple-import-sort: ^7.0.0
|
||||
eslint-plugin-unused-imports: ^2.0.0
|
||||
husky: ^7.0.4
|
||||
prettier: ^2.5.1
|
||||
typescript: ^4.5.5
|
||||
dependencies:
|
||||
|
@ -32,6 +33,7 @@ importers:
|
|||
eslint-plugin-prettier: 4.0.0_f3d13a703a9c1079e3d1af6044603beb
|
||||
eslint-plugin-simple-import-sort: 7.0.0_eslint@8.10.0
|
||||
eslint-plugin-unused-imports: 2.0.0_5048693f84252cfc01b1f5d975a3323d
|
||||
husky: 7.0.4
|
||||
prettier: 2.5.1
|
||||
typescript: 4.5.5
|
||||
|
||||
|
@ -4888,6 +4890,12 @@ packages:
|
|||
engines: {node: '>=8.12.0'}
|
||||
dev: true
|
||||
|
||||
/husky/7.0.4:
|
||||
resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/i18next-fs-backend/1.1.4:
|
||||
resolution: {integrity: sha512-/MfAGMP0jHonV966uFf9PkWWuDjPYLIcsipnSO3NxpNtAgRUKLTwvm85fEmsF6hGeu0zbZiCQ3W74jwO6K9uXA==}
|
||||
dev: false
|
||||
|
|
Loading…
Reference in New Issue