-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc
121 lines (120 loc) · 3.4 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
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
{
"extends": ["airbnb-base", "airbnb-typescript/base", "plugin:prettier/recommended", "plugin:eslint-comments/recommended", "plugin:sonarjs/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "sonarjs"],
"root": true,
"parserOptions": {
"project": ["./tsconfig.json", "./test/tsconfig.json"]
},
"ignorePatterns": [
"jest.config.cjs",
"jest-stackblitz.config.cjs",
"docs/*",
"*.json"
],
"rules": {
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/parameter-properties": [
"error",
{
"allow": [
"public",
"private",
"private readonly",
"public readonly",
"protected",
"protected readonly"
]
}
],
"@typescript-eslint/consistent-indexed-object-style": "off",
"import/prefer-default-export": "off",
"object-shorthand": "off",
"max-classes-per-file": ["error", 6],
"@typescript-eslint/no-magic-numbers": "off",
"class-methods-use-this": "off",
"@typescript-eslint/return-await": ["error", "always"],
"import/no-import-module-exports": "off",
// When overriding methods, this forces us to remove them, even though it is a good pattern
// to still declare args of overriden methods
"@typescript-eslint/no-unused-vars": ["error", {
"args": "none"
}],
"import/order": [
"error",
{
"newlines-between": "always"
}
],
"no-param-reassign": [
"error",
{
"props": false
}
],
"eslint-comments/no-unused-disable": ["error"],
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/consistent-type-assertions": ["error", {
"assertionStyle": "never"
}],
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"@typescript-eslint/no-use-before-define": ["error", {
"ignoreTypeReferences": true
}],
"no-undef-init": "off",
// Only to enforce comments length, code will be checked by prettier
"max-len": ["error", 1000, {
"comments": 100,
"ignoreComments": false,
"ignoreUrls": true,
"ignoreStrings": true
}],
"sonarjs/cognitive-complexity": [
"error",
13
],
"no-restricted-syntax": "off",
"no-void": ["error", {
"allowAsStatement": true
}],
// Introduce at some point in the future
// "@typescript-eslint/explicit-function-return-type": "error",
// Reenable again
"sonarjs/no-duplicate-string": "off",
// Handled by prettier
"@typescript-eslint/indent": ["off"],
"@typescript-eslint/no-floating-promises": "error"
},
"overrides": [
{
"files": ["*.test.ts", "**/test/**/*.ts"],
"rules": {
"no-console": "off",
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/init-declarations": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"no-await-in-loop": "off",
"no-plusplus": "off"
}
},
{
"files": ["index.ts"],
"rules": {}
},
{
"files": ["cli.ts"],
"rules": {
// Disable this because of the comment shell thingy in cli.tsx
"max-len": "off"
}
}
]
}