forked from discretize/discretize-gear-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
110 lines (105 loc) · 3.02 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
{
"env": {
"browser": true,
"es6": true,
"jquery": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"react-app",
"airbnb/whitespace",
"airbnb/hooks",
"plugin:jsdoc/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["/plugins/*"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
// disabled or reduced
"no-restricted-syntax": "off",
"no-plusplus": "off",
"func-names": "off",
"no-continue": "off",
"no-param-reassign": ["warn", { "props": false }],
"consistent-return": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^e$|^theme$|^_", "varsIgnorePattern": "^e$|^theme$|^_" }
],
"lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }],
// temp
"react/prop-types": "off",
"react/jsx-props-no-spreading": "off",
// plugin-jsdoc defaults are quite problematic
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-returns": "off", // breaks @yield
"jsdoc/tag-lines": "off", // breaks @example
// prettier compat
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"id-length": [
"warn",
{
"exceptions": [
// counters and comparisons
"i",
"j",
"a",
"b",
// events and errors
"e",
// i18next translation function
"t",
// unused arguments
"_",
// mui system margin/padding
"m",
"p"
]
}
],
// typescript:
"react/jsx-filename-extension": ["warn", { "extensions": [".jsx", ".tsx"] }],
"import/extensions": [
"warn",
"ignorePackages",
{ "js": "never", "jsx": "never", "ts": "never", "tsx": "never" }
],
// Replace base rules with typescript-aware rules
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
// Being explicit about types is sometimes good
"@typescript-eslint/no-inferrable-types": "off",
// We want to enable these eventually
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"overrides": [
{
"files": ["extract_context_injection/*", "*"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"no-console": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {
// Disable these rules on javascript files because they would enforce new rules or yield false positives.
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-use-before-define": "off"
}
}
]
}