-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
54 lines (54 loc) · 1.28 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
// 指定ESLint可以解析JSX语法
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended", // Make sure this is always the last element in the array.
],
plugins: [
"simple-import-sort",
"prettier",
"@typescript-eslint",
"react",
"react-hooks",
],
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
globals: {
NodeJS: true,
require: true,
process: true,
$request: true,
$message: true,
},
settings: {
// 自动发现React的版本,从而进行规范react代码
react: {
pragma: "React",
version: "detect",
},
},
rules: {
"prettier/prettier": ["error", {}, { usePrettierrc: true }],
"react/prop-types": "off",
// "simple-import-sort/imports": "error",
// "simple-import-sort/exports": "error",
"simple-import-sort/imports": "off", // 关闭排序校验
"simple-import-sort/exports": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": 0, //允许用断言
},
};