-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.json
116 lines (116 loc) 路 4.52 KB
/
.eslintrc.json
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"plugin:react/recommended",
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module",
"project": "tsconfig.eslint.json"
},
"plugins": [
"react",
"@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react/prop-types": "off",
"no-unused-vars": "off",
"react/no-unescaped-entities": "off",
"no-shadow": "error",
"max-len": ["error", { "code": 120, "tabWidth": 2, "ignoreTemplateLiterals": true, "ignoreComments": true }],
"react/jsx-first-prop-new-line": ["error", "multiline"],
"no-undef": "off",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-extra-parens": "off",
"@typescript-eslint/no-extra-parens": ["warn", "all", { "ignoreJSX": "multi-line" }],
"semi": "off",
"@typescript-eslint/semi": ["warn", "always", { "omitLastInOneLineBlock": true }],
"@typescript-eslint/member-delimiter-style": "warn",
"react/jsx-fragments": "warn",
"@typescript-eslint/await-thenable": "error",
"brace-style": "off",
"@typescript-eslint/brace-style": ["error"],
"camelcase": "off",
"@typescript-eslint/camelcase": ["warn"],
"comma-spacing": "off",
"@typescript-eslint/comma-spacing": ["warn"],
"func-call-spacing": "off",
"@typescript-eslint/func-call-spacing": ["warn"],
"indent": "off",
"@typescript-eslint/indent": ["warn", 2, {
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"MemberExpression": 1,
"FunctionDeclaration": { "parameters": 1, "body": 1 },
"FunctionExpression": { "parameters": 1, "body": 1 },
"CallExpression": { "arguments": 1 },
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoreComments": false,
"ignoredNodes": ["TemplateLiteral *"]
}],
"@typescript-eslint/no-extra-non-null-assertion": "warn",
"no-extra-semi": "off",
"@typescript-eslint/no-extra-semi": ["warn"],
"@typescript-eslint/no-implied-eval": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-condition": ["off", { "ignoreRhs": true }],
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"quotes": "off",
"@typescript-eslint/quotes": ["warn", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
"@typescript-eslint/restrict-template-expressions": ["error", { "allowNumber": true, "allowBoolean": true }],
"@typescript-eslint/type-annotation-spacing": "warn",
"react/jsx-max-props-per-line": ["error", { "maximum": 1, "when": "multiline" }],
"react/jsx-tag-spacing": ["warn"],
"react/jsx-closing-bracket-location": ["warn", "tag-aligned"],
"react/jsx-wrap-multilines": ["warn", {
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "ignore"
}],
"react/jsx-boolean-value": ["warn", "never"],
"react/jsx-closing-tag-location": "warn",
"react/jsx-curly-brace-presence": ["warn", { "props": "never", "children": "never" }],
"react/jsx-curly-newline": ["warn", { "multiline": "forbid", "singleline": "forbid" }],
"react/jsx-curly-spacing": ["warn", "never"],
"react/jsx-equals-spacing": "warn",
"react/jsx-indent-props": ["warn", 2],
"react/jsx-indent": ["warn", 2],
"react/jsx-props-no-multi-spaces": "warn",
"react/no-danger-with-children": "error",
"react/no-deprecated": "error",
"react/no-direct-mutation-state": "error",
"react/display-name": "off",
"no-unused-expressions": "off"
}
}