chore(配置): 添加代码规范和格式化配置
- 配置 ESLint 代码检查规则和忽略文件 - 配置 Prettier 代码格式化规则 - 配置 StyleLint 样式检查规则和忽略文件 - 配置 Husky Git hooks 实现提交前自动检查
This commit is contained in:
parent
691090f573
commit
37dd759ff9
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
34
.eslintrc
Normal file
34
.eslintrc
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"commonjs": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true,
|
||||||
|
"jest": true
|
||||||
|
},
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"extends": [
|
||||||
|
"prettier",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"experimentalObjectRestSpread": true,
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "16.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": ["react", "babel", "@typescript-eslint/eslint-plugin"],
|
||||||
|
"rules": {
|
||||||
|
"react/display-name": 0,
|
||||||
|
"react/prop-types": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
6
.husky/pre-commit
Executable file
6
.husky/pre-commit
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npm run pre-commit
|
||||||
|
npm run pre-commit
|
||||||
|
npm run pre-commit
|
||||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"jsxSingleQuote": false,
|
||||||
|
"useTabs": false,
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
4
.stylelintignore
Normal file
4
.stylelintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
**/*.ts
|
||||||
|
**/*.tsx
|
||||||
|
**/*.jsx
|
||||||
|
**/*.js
|
||||||
17
.stylelintrc
Normal file
17
.stylelintrc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
|
||||||
|
"customSyntax": "postcss-less",
|
||||||
|
"rules": {
|
||||||
|
"selector-class-pattern": null,
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"no-duplicate-selectors": null,
|
||||||
|
"color-function-notation": null,
|
||||||
|
"font-family-no-missing-generic-family-keyword": null,
|
||||||
|
"selector-pseudo-class-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignorePseudoClasses": ["global"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user