-
Notifications
You must be signed in to change notification settings - Fork 83
/
.eslintrc.json
161 lines (161 loc) · 4.81 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
"settings": {
"import/resolver": {
"typescript": {}
},
"lintAllEsApis": true,
"polyfills": [
"URL",
"URLSearchParams",
"Promise",
"Number.isNaN",
"Number.isInteger",
"Array.from",
"Array.prototype.find",
"Array.prototype.includes",
"String.prototype.endsWith",
"String.prototype.startsWith",
"String.prototype.includes",
"String.prototype.replaceAll",
"String.fromCodePoint",
"Object.entries",
"Object.values",
"Object.assign",
"Object.fromEntries",
"TextEncoder",
"TextDecoder",
"CustomEvent",
"requestAnimationFrame",
"cancelAnimationFrame",
"navigator.sendBeacon",
"Uint8Array",
"Set",
"atob"
]
},
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"overrides": [
{
"files": ["*.js", "*.ts"],
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended-legacy",
"prettier",
"plugin:compat/recommended"
],
"plugins": ["@typescript-eslint", "unicorn", "compat", "@nx"],
"parser": "@typescript-eslint/parser",
"globals": {},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"compat/compat": [
"warn",
"defaults,Edge >= 80,Firefox >= 47,IE >= 11,Chrome >= 54,Safari >= 7,Opera >= 43"
],
"import/prefer-default-export": "off",
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true,
"kebabCase": true
}
}
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "error",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
"unicorn/explicit-length-check": "error",
"unicorn/prefer-array-find": "error",
"unicorn/no-lonely-if": "error",
"unicorn/prefer-includes": "off",
"unicorn/prefer-array-flat-map": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"sonarjs/prefer-immediate-return": "off",
"sonarjs/no-nested-template-literals": "off",
"sonarjs/max-switch-cases": "off",
"sonarjs/cognitive-complexity": ["error", 40],
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"varsIgnorePattern": "^CatchErr"
}
],
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
"@typescript-eslint/consistent-type-imports": [
"error",
{ "fixStyle": "inline-type-imports" }
],
"@typescript-eslint/no-import-type-side-effects": "error",
"no-console": "off",
"no-plusplus": "off",
"import/no-extraneous-dependencies": "off",
"@nx/enforce-module-boundaries": [
"error",
{
"allow": ["rudderAnalyticsRemotePlugins/*"],
"banTransitiveDependencies": true,
"depConstraints": [
{
"sourceTag": "type:lib",
"onlyDependOnLibsWithTags": ["type:lib"]
},
{
"sourceTag": "type:sdk",
"onlyDependOnLibsWithTags": ["type:lib"]
},
{
"sourceTag": "type:app",
"onlyDependOnLibsWithTags": ["type:sdk"]
},
{
"sourceTag": "scope:shared",
"onlyDependOnLibsWithTags": ["scope:shared"]
}
]
}
]
}
},
{
"files": ["{package,project}.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"warn",
{
"buildTargets": ["build"],
"checkMissingDependencies": true,
"checkObsoleteDependencies": true,
"checkVersionMismatches": true,
"ignoredDependencies": []
}
]
}
}
]
}