forked from saleor/saleor-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
103 lines (103 loc) · 3.35 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
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"standard-with-typescript",
"plugin:react/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"react": {
"version": "detect"
}
},
"plugins": [
"react",
"import",
"local-rules",
"cypress",
"formatjs",
"react-refresh",
"react-hooks",
"simple-import-sort"
],
"overrides": [
{
"files": ["src/**/*.test.*", "src/**/*.stories.*"],
"rules": {
"react-refresh/only-export-components": "off"
}
}
],
"rules": {
// Custom rules:
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": "off", // imports are handled by simple-import-sort/sort
"import/no-internal-modules": "off", // imports are handled by simple-import-sort/sort
"import/order": "off", // imports are handled by simple-import-sort/sort
"sort-imports": "off", // imports are handled by simple-import-sort/sort
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"react-hooks/rules-of-hooks": "error",
"formatjs/enforce-id": [
"error",
{
"idInterpolationPattern": "[sha512:contenthash:base64:6]"
}
],
"local-rules/named-styles": "error",
"no-restricted-imports": [
"error",
{
"paths": ["lodash", "@material-ui/icons/Delete", "classnames"]
}
],
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
],
// Decided to turn off:
"react/prop-types": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
// Migration in progress:
// Tracked in https://github.com/saleor/saleor-dashboard/issues/3813
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/return-await": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"multiline-ternary": "off",
"no-extra-boolean-cast": "off",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"react-refresh/only-export-components": "warn"
},
"ignorePatterns": ["node_modules/", "**/types/**/*", "type-policies.ts"]
}