-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
121 lines (115 loc) · 3.58 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"tsconfigRootDir": ".",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "sonarjs", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:sonarjs/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:prettier/recommended"
],
"ignorePatterns": ["**/node_modules/**", "dist/**", "*.graphql"],
"rules": {
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-duplicate-enum-values": "off",
// These rules are for reference only.
//#region eslint
"class-methods-use-this": "off",
// https://github.com/typescript-eslint/typescript-eslint/issues/1277
"consistent-return": "off",
"func-names": "off",
"max-len": ["error", { "code": 140, "ignoreTemplateLiterals": true, "ignoreUrls": true }],
"newline-per-chained-call": "off",
"no-await-in-loop": "off",
"no-continue": "off",
// https://github.com/airbnb/javascript/issues/1342
"no-param-reassign": ["error", { "props": false }],
// https://github.com/airbnb/javascript/issues/1271
// https://github.com/airbnb/javascript/blob/fd77bbebb77362ddecfef7aba3bf6abf7bdd81f2/packages/eslint-config-airbnb-base/rules/style.js#L340-L358
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
"no-underscore-dangle": ["error", { "allow": ["_id"] }],
"no-void": ["error", { "allowAsStatement": true }],
"object-curly-newline": "off",
"spaced-comment": [
"error",
"always",
{ "line": { "markers": ["/", "#region", "#endregion"] } }
],
//#endregion
//#region import
"import/extensions": ["error", "never"],
// https://github.com/benmosher/eslint-plugin-import/issues/1753
"import/named": "off",
"import/no-default-export": "error",
"import/order": [
"error",
{
"groups": [["builtin", "external", "internal"]],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
],
"import/prefer-default-export": "off",
//#endregion
//#region @typescript-eslint
"@typescript-eslint/consistent-type-assertions": [
"error",
{ "assertionStyle": "angle-bracket" }
],
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "default", "format": ["strictCamelCase"] },
{ "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] },
// https://github.com/microsoft/TypeScript/issues/9458
{
"selector": "parameter",
"modifiers": ["unused"],
"format": ["strictCamelCase"],
"leadingUnderscore": "allow"
},
{ "selector": "property", "format": null },
{ "selector": "typeProperty", "format": null },
{ "selector": "typeLike", "format": ["StrictPascalCase"] },
{ "selector": "enumMember", "format": ["UPPER_CASE"] }
],
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
//#endregion
//#region sonarjs
"sonarjs/no-duplicate-string": "off",
"sonarjs/cognitive-complexity": ["error", 25],
//#endregion
"prettier/prettier": [
"error",
{
"singleQuote": true,
"endOfLine": "auto"
}
],
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
]
}
}