-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
108 lines (100 loc) · 3.55 KB
/
.eslintrc.json
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
{
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"project": "./tsconfig.json",
"extraFileExtensions": [".vue"],
"sourceType": "module"
},
"plugins": [
"@typescript-eslint/eslint-plugin",
"simple-import-sort",
"import"
],
"extends": [
"eslint:all",
"@nuxtjs/eslint-config-typescript",
"plugin:vue/vue3-recommended",
"plugin:@typescript-eslint/all",
"plugin:typescript-sort-keys/recommended",
"prettier"
],
"root": true,
"env": {
"node": true
},
"rules": {
// disabled rules (required)
"no-void": "off", // To call promise functions without other actions
"no-magic-numbers": "off", // This will wrongly detect a number passed to a function as a magic number
"@typescript-eslint/no-magic-numbers": "off",
"new-cap": "off", // The decorators will be wrongly detected
"class-methods-use-this": "off", // some methods are not using this
"require-await": "off", // it will wrongly detect async methods as not having await
"@typescript-eslint/require-await": "off",
"max-params": "off", // injection constructors need many parameters
// disabled rules (optional, in personal preference)
"no-console": "off", // This will disable console.log, console.error, etc. This could be removed if we have our own logger
"one-var": "off", // in favor to not merge variables to one
"no-continue": "off", // in favor to use continue
// disabled typescript-eslint rules (too strict)
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/parameter-properties": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-type-alias": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
// modified rules
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
// replaced rules
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"sort-imports": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
// additional rules
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports"
}
],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{
"blankLine": "always",
"prev": ["const", "let", "var", "multiline-expression"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "error"
},
"overrides": [
{
"files": ["*.spec.ts", "*.e2e-spec.ts"],
"rules": {
"@typescript-eslint/init-declarations": "off",
"max-lines-per-function": "off"
}
}
]
}