This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
119 lines (119 loc) · 3.91 KB
/
.eslintrc
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
117
118
119
{
"extends": [
"airbnb",
"prettier",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"prettier/react",
"prettier/@typescript-eslint"
],
"plugins": ["@typescript-eslint", "jest", "unicorn", "react-hooks"],
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
},
"rules": {
"react/require-default-props": 0,
"react/jsx-wrap-multilines": 0,
"react/prop-types": 0,
"react/forbid-prop-types": 0,
"react/jsx-one-expression-per-line": 0,
"react/sort-comp": 0,
"generator-star-spacing": 0,
"function-paren-newline": 0,
"import/no-unresolved": [1, { "ignore": ["^@/", "^umi/", "^#/"] }],
"import/no-extraneous-dependencies": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/label-has-associated-control": 0,
"jsx-a11y/heading-has-content": 0,
"jsx-a11y/label-has-for": [
2,
{
"required": {
"every": ["id"]
},
"allowChildren": false
}
],
"linebreak-style": 0,
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
"no-prototype-builtins": "off",
"import/prefer-default-export": "off",
"import/no-default-export": [0, "camel-case"],
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": "off",
"max-len": "warn",
"sort-imports": 0,
"no-unused-expressions": 0,
"@typescript-eslint/no-unused-expressions": "error",
// Use function hoisting to improve code readability
"no-use-before-define": [
"warn",
{ "functions": false, "classes": true, "variables": true }
],
// Makes no sense to allow type inferrence for expression parameters, but require typing the response
"@typescript-eslint/explicit-function-return-type": [
"off",
{ "allowTypedFunctionExpressions": true }
],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-use-before-define": [
"warn",
{
"functions": false,
"classes": true,
"variables": true,
"typedefs": true
}
],
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-inferrable-types": 0,
// Common abbreviations are known and readable
"unicorn/prevent-abbreviations": "off",
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-angle-bracket-type-assertion": 0,
"@typescript-eslint/no-empty-function": 0,
"import/no-cycle": 0,
"react-hooks/rules-of-hooks": "warn",
"react/no-array-index-key": "warn",
// issue https://github.com/facebook/react/issues/15204
"react-hooks/exhaustive-deps": "off",
// Conflict with prettier
"arrow-body-style": 0,
"space-before-function-paren": 0,
"object-curly-newline": 0,
"implicit-arrow-linebreak": 0,
"operator-linebreak": 0,
"no-mixed-operators": "warn",
"no-console": ["error", { "allow": ["warn", "error"] }],
"comma-dangle": 0,
"quotes": 0,
"no-else-return": 0,
"import/export": 0,
"react/self-closing-comp": "error",
"consistent-return": 0,
"no-useless-constructor": 0,
"no-restricted-syntax": 0,
"jest/no-jest-import": 0,
"func-names": "off",
"import/no-named-as-default": 0
},
"settings": {
"import/resolver": {
"node": { "extensions": [".js", ".jsx", ".ts", ".tsx", ".d.ts"] }
}
}
}