-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
72 lines (72 loc) · 2.54 KB
/
.eslintrc.cjs
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
// yeah, ignore this warning.
module.exports = {
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"eslint-plugin-import",
],
env: {
es6: true,
node: true,
},
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
project: [
"./tsconfig.json",
],
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
],
rules: { //individual rule config for typescript
"@typescript-eslint/type-annotation-spacing": ["error", { "before": true } ],
"@typescript-eslint/indent": [ "error", 2],
"@typescript-eslint/no-parameter-properties": ["off"],
"@typescript-eslint/no-use-before-define": ["off"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/no-floating-promises" : "error",
"@typescript-eslint/no-misused-promises" : [ "error", { checkConditionals: true, checkVoidReturn: true } ],
"@typescript-eslint/ban-types" : ["error", { "types": { "Function": false, "object": false } }],
"@typescript-eslint/no-extra-semi" : ["off"],
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/explicit-module-boundary-types": ["warn", { allowArgumentsExplicitlyTypedAsAny: true }],
"no-trailing-spaces": ["warn"],
"max-len": ["warn" , { "code" : 120 }],
"no-warning-comments": ["warn", { terms: ["TODO", "FIX"], location: "start" }],
"max-depth": ["error", { "max" : 4 }],
"semi": ["error", "always"],
"space-before-blocks": ["warn", "always"],
"space-before-function-paren": ["warn", "always"],
"space-in-parens": ["error", "never"],
"max-classes-per-file": ["error", 1],
"no-param-reassign": ["error"],
"no-return-assign": ["error"],
"no-return-await": ["error"],
"no-self-compare": ["error"],
"no-shadow": ["off"],
"comma-dangle": ["warn", "always-multiline"],
"eol-last": ["error", "always"],
"max-params": ["error", 3],
"max-lines-per-function": ["warn", { max: 15, skipComments: true, skipBlankLines: true }],
"object-curly-spacing": ["warn", "always"],
"space-before-function-paren": ["warn", "always"],
"quotes": ["warn", "double"],
"lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }],
"curly": ["error", "multi-line"],
},
"overrides": [
{
"files": ["*.spec.ts"],
"rules": {
"max-lines-per-function": "off",
},
},
],
};