-
Notifications
You must be signed in to change notification settings - Fork 14
/
.eslintrc
67 lines (66 loc) · 2.22 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
{
"root": true,
"env": {
"node": true,
// 'browser': true, // I had this set before but idk why
// 'commonjs': true, // I had this set before but idk why
"es2022": true
},
"extends": [
"airbnb-base",
"plugin:sonarjs/recommended"
],
"plugins": [
"@typescript-eslint/eslint-plugin",
"sonarjs"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "script",
"ecmaVersion": 2022
},
"rules": {
// This enforces strict checks on .js files, it's not necessary for .ts files
// https://www.w3schools.com/js/js_strict.asp
"strict": [2, "global"],
// Removes () around single parameter arrow functions
"arrow-parens": [2, "as-needed"],
// This is a personal preference to enforce good code
"@typescript-eslint/no-non-null-assertion": "warn",
// Enforce max line length of 120
"max-len": ["warn", { "code": 120 }],
// Allow allow any on objects, require definition of types
"@typescript-eslint/no-explicit-any": "warn",
// The following will show up as errors, just want to get this pushed for now
"sonarjs/cognitive-complexity": ["warn", 50]
},
"overrides": [
{
"files": ["**/*.ts","**/*.tsx","**/*.*.ts"],
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:sonarjs/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
// This enforces strict checks on .js files, it's not necessary for .ts files
// https://www.w3schools.com/js/js_strict.asp
"strict": [2, "global"],
// Removes () around single parameter arrow functions
"arrow-parens": [2, "as-needed"],
// This is a personal preference to enforce good code
"@typescript-eslint/no-non-null-assertion": "warn",
// Enforce max line length of 120
"max-len": ["warn", { "code": 120 }],
// Allow allow any on objects, require definition of types
"@typescript-eslint/no-explicit-any": "warn",
// The following will show up as errors, just want to get this pushed for now
"sonarjs/cognitive-complexity": ["warn", 50]
}
}
]
}