init
This commit is contained in:
46
.eslintrc.cjs
Normal file
46
.eslintrc.cjs
Normal file
@@ -0,0 +1,46 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"files": [
|
||||
".eslintrc.{js,cjs}"
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "script"
|
||||
}
|
||||
}
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"react",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
'react/jsx-use-react': 0, // React V17开始JSX已经不再需要引入React
|
||||
'react/react-in-jsx-scope': 0, // 同上
|
||||
'import/first': 0, // 消除绝对路径必须要在相对路径前引入,
|
||||
'no-mixed-spaces-and-tabs': 2, // 禁止空格和 tab 的混合缩进
|
||||
'no-debugger': 2, // 禁止有debugger
|
||||
'space-infix-ops': 2, // 要求操作符周围有空格
|
||||
'space-before-blocks': 2, // 要求语句块之前有空格
|
||||
'@typescript-eslint/explicit-function-return-type': 0, // 禁止函数必须要定义返回类型
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user