Add linting and precommits (#295)
* chore: prefer yarn * dx: linting configurations, and pre-commit hook
This commit is contained in:
parent
b0d00e4c70
commit
bc8f2980d3
8 changed files with 1106 additions and 3981 deletions
32
.eslintrc.json
Normal file
32
.eslintrc.json
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
|
"sourceType": "module",
|
||||||
|
"modules": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"prettier",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
|
],
|
||||||
|
"plugins": ["@typescript-eslint", "prettier", "react", "react-hooks"],
|
||||||
|
"rules": {
|
||||||
|
"prettier/prettier": ["error"],
|
||||||
|
"@typescript-eslint/no-unused-vars": "error"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "detect"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
_
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
yarn lint-staged
|
6
.prettierignore
Normal file
6
.prettierignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
public
|
||||||
|
**/**/node_modules
|
||||||
|
**/**/.next
|
||||||
|
**/**/public
|
10
.prettierrc.js
Normal file
10
.prettierrc.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
module.exports = {
|
||||||
|
bracketSpacing: true,
|
||||||
|
jsxBracketSameLine: true,
|
||||||
|
singleQuote: false,
|
||||||
|
jsxSingleQuote: false,
|
||||||
|
trailingComma: "es5",
|
||||||
|
semi: true,
|
||||||
|
printWidth: 110,
|
||||||
|
arrowParens: "always",
|
||||||
|
};
|
3966
package-lock.json
generated
3966
package-lock.json
generated
File diff suppressed because it is too large
Load diff
25
package.json
25
package.json
|
@ -6,7 +6,10 @@
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"postinstall": "prisma generate"
|
"postinstall": "prisma generate",
|
||||||
|
"pre-commit": "lint-staged",
|
||||||
|
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
|
||||||
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/react": "^1.0.0",
|
"@headlessui/react": "^1.0.0",
|
||||||
|
@ -34,10 +37,26 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^14.14.33",
|
"@types/node": "^14.14.33",
|
||||||
"@types/react": "^17.0.3",
|
"@types/react": "^17.0.3",
|
||||||
"autoprefixer": "^10.2.6",
|
"@typescript-eslint/eslint-plugin": "^4.27.0",
|
||||||
"postcss": "^8.3.5",
|
"@typescript-eslint/parser": "^4.27.0",
|
||||||
|
"autoprefixer": "^10.2.5",
|
||||||
|
"eslint": "^7.29.0",
|
||||||
|
"eslint-config-prettier": "^8.3.0",
|
||||||
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
|
"eslint-plugin-react": "^7.24.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
|
"husky": "^6.0.0",
|
||||||
|
"lint-staged": "^11.0.0",
|
||||||
|
"postcss": "^8.2.8",
|
||||||
|
"prettier": "^2.3.1",
|
||||||
"prisma": "^2.23.0",
|
"prisma": "^2.23.0",
|
||||||
"tailwindcss": "^2.2.2",
|
"tailwindcss": "^2.2.2",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"./{*,{pages,components,lib}/**/*}.{js,ts,jsx,tsx}": [
|
||||||
|
"prettier --write",
|
||||||
|
"eslint"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue