-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
119 lines (119 loc) · 3.52 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
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
module.exports = {
plugins: [
"react",
"react-hooks",
"@typescript-eslint",
"import",
"functional",
"jest",
],
extends: [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"prettier",
],
rules: {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unnecessary-condition": [
"error",
{ allowConstantLoopConditions: true },
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"react/prop-types": ["off"],
"react/require-default-props": ["off"],
"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"import/named": "off",
"functional/no-class": "error",
"functional/prefer-type-literal": "error",
"functional/no-this-expression": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"**/*.spec.{ts,tsx}",
"**/*.stories.{ts,tsx}",
"**/test-utils.{ts,tsx}",
"**/.jest/*.{ts,tsx,js}",
"**/e2e/**/*.{ts,tsx,js}",
"**/webpack/*.js",
"**/.storybook/*.{js,ts}",
"**/__mocks__/**/*.{ts,tsx}",
"**/jest.*.js",
"**/storyshots*.ts",
],
},
],
"default-case": "off",
"react/jsx-filename-extension": [1, { extensions: [".tsx"] }],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": ["error", { default: "array" }],
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
parserOptions: {
project: "./tsconfig.eslint.json",
warnOnUnsupportedTypeScriptVersion: false,
},
overrides: [
{
files: ["**/*.spec.{ts,tsx}", "**/__mocks__/**/*"],
env: {
jest: true,
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"react/jsx-props-no-spreading": "off",
"no-constant-condition": "off",
"no-empty": "off",
"no-await-in-loop": "off",
},
},
{
files: ["*.d.ts"],
rules: {
// Fix to /// imports in .d.ts
"spaced-comment": ["error", "always", { markers: ["/"] }],
"@typescript-eslint/no-unused-vars": "off",
"functional/no-class": "off",
"no-shadow": "off",
},
},
{
files: ["*.js", "*.json"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"import/named": "error",
},
},
],
};