-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
137 lines (120 loc) · 4.37 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
"extends": [
"eslint:recommended",
// "hardcore",
// "hardcore/react",
// "hardcore/react-testing-library",
// "hardcore/jest",
// "hardcore/fp",
// "hardcore/ts",
"react-app",
"react-app/jest",
"plugin:jsx-a11y/strict",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react-perf/all", // same as recommended
"plugin:regexp/recommended",
"plugin:sonarjs/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:unicorn/recommended"
],
"env": {
"browser": true
},
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": [
"jsx-a11y",
"jest",
"jest-dom",
"testing-library",
"react",
"react-hooks",
"react-perf",
"regexp",
"sonarjs",
"@typescript-eslint",
"unicorn",
"write-good-comments"
],
"reportUnusedDisableDirectives": true,
"rules": {
"no-alert": "error", // It's deprecated
"no-return-await": "warn",
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-numeric-literals": "warn",
"prefer-promise-reject-errors": "warn",
"prefer-regex-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"jest/no-commented-out-tests": "warn",
"jest/no-identical-title": "warn",
"jest/prefer-called-with": "warn",
"jest/prefer-expect-assertions": "off",
"jest/prefer-hooks-on-top": "off",
"jest/prefer-spy-on": "warn",
"jest/prefer-strict-equal": "warn",
"jest/prefer-to-be": "error",
"jest/prefer-to-contain": "error",
"jest/prefer-to-have-length": "error",
"jest/prefer-todo": "warn",
"jest/valid-describe-callback": "error",
"jest/valid-expect": "error",
"jest/valid-expect-in-promise": "error",
"jest/valid-title": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off", // Check every once in a while
"@typescript-eslint/unbound-method": "off", // Invalid errors - methods ARE bound silly
"@typescript-eslint/no-invalid-this": "warn",
"@typescript-eslint/no-invalid-void-type": "warn",
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "varsIgnorePattern": "^_"}],
"@typescript-eslint/prefer-enum-initializers": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-literal-enum-member": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"react/button-has-type": "warn",
"react/prefer-read-only-props": "warn",
// TODO: fix errors
"sonarjs/cognitive-complexity": "off",
"testing-library/await-fire-event": "warn",
"testing-library/prefer-explicit-assert": "warn",
"unicorn/explicit-length-check": "off",
"unicorn/filename-case": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-reduce": "off", // git gud: .reduce((accum, current) => newAccum, startAccum)
"unicorn/no-lonely-if": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/no-null": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-spread": "off", // More explicit sometimes
"unicorn/prevent-abbreviations": "off", // If you don't understand, see here: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/shared/abbreviations.js
"unicorn/throw-new-error": "off",
"write-good-comments/write-good-comments": "off",
// disabling base rules
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error"
},
"settings": {
"linkComponents": [
"ExternalLink"
]
}
}