forked from CatsMiaow/node-grpc-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
75 lines (71 loc) · 3.59 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"tsconfigRootDir": ".",
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "sonarjs"],
"extends": [
"eslint:recommended",
"airbnb-typescript/base",
"plugin:sonarjs/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"rules": {
"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 }],
"newline-per-chained-call": "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/master/packages/eslint-config-airbnb-base/rules/style.js#L334-L352
"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"] } }],
// Change eslint rule to @typescript-eslint rule
"lines-between-class-members": "off",
"no-return-await": "off",
"no-unused-expressions": "off",
// https://github.com/benmosher/eslint-plugin-import/issues/1453
"import/no-cycle": "off",
"import/no-default-export": "error",
"import/prefer-default-export": "off",
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "angle-bracket" }],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", { "overrides": { "constructors": "no-public" } }],
// https://github.com/typescript-eslint/typescript-eslint/issues/977
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": ["error",
{ "selector": "default", "format": ["strictCamelCase"] },
{ "selector": "variable", "format": ["camelCase", "PascalCase", "UPPER_CASE"] },
{ "selector": "property", "format": null, "leadingUnderscore": "allow" },
{ "selector": "typeLike", "format": ["StrictPascalCase"] },
{ "selector": "enumMember", "format": ["UPPER_CASE"] }],
"@typescript-eslint/no-floating-promises": ["error", { "ignoreIIFE": true, "ignoreVoid": true }],
// https://github.com/typescript-eslint/typescript-eslint/issues/902
"@typescript-eslint/no-inferrable-types": ["error", { "ignoreParameters": true, "ignoreProperties": true }],
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-includes": "off",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/typedef": "error",
"@typescript-eslint/unbound-method": ["error", { "ignoreStatic": true }],
"sonarjs/no-duplicate-string": "off"
}
}