generated from ampersandcorp/nestjs-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
158 lines (158 loc) Β· 4.58 KB
/
.eslintrc.js
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 'latest',
sourceType: "module",
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/recommended',
],
env: {
node: true,
jest: true,
},
ignorePatterns: [
'.eslintrc.js',
"src/**/*.spec.ts",
"tests/**/*.ts",
],
rules: {
'init-declarations': 'off',
'no-dupe-class-members': 'off',
'no-implied-eval': 'off',
'no-invalid-this': 'off',
'no-magic-numbers': 'off',
'no-redeclare': 'off',
'no-unused-vars': 'off',
'semi': 'off',
'quotes': 'off',
'brace-style': 'off',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
"@typescript-eslint/init-declarations": "error",
"@typescript-eslint/no-empty-interface": "warn",
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/member-delimiter-style': [
'error',
{
'multiline': {
'delimiter': 'semi',
'requireLast': true,
},
'singleline': {
'delimiter': 'semi',
'requireLast': true,
},
},
],
'@typescript-eslint/method-signature-style': [
'error',
'method',
],
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'variable',
'modifiers': ['const'],
'format': ['UPPER_CASE', 'camelCase'],
},
{
'selector': 'variable',
'modifiers': ['exported'],
'format': [],
},
{
'selector': 'variable',
'modifiers': ['unused'],
'format': ['camelCase'],
'leadingUnderscore': 'require',
},
{
'selector': 'accessor',
'modifiers': ['static'],
'format': ['UPPER_CASE'],
},
{
'selector': 'enumMember',
'format': ['UPPER_CASE'],
},
{
'selector': 'class',
'format': ['PascalCase'],
},
{
'selector': 'interface',
'format': ['PascalCase'],
},
{
'selector': 'typeAlias',
'format': ['PascalCase'],
},
{
'selector': 'enum',
'format': ['UPPER_CASE', 'PascalCase'],
},
{
'selector': 'typeParameter',
'format': ['PascalCase'],
},
],
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-redeclare': 'warn',
'@typescript-eslint/no-redundant-type-constituents': 'error',
'@typescript-eslint/no-type-alias': [
'error',
{
'allowAliases': 'always',
'allowCallbacks': 'never',
'allowConditionalTypes': 'always',
'allowConstructors': 'never',
'allowLiterals': 'never',
'allowMappedTypes': 'always',
'allowTupleTypes': 'always',
'allowGenerics': 'always',
}
],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-useless-empty-export': 'error',
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'off',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-literal-enum-member': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-return-this-type': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/quotes': [
'error',
'single'
],
'@typescript-eslint/semi': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/brace-style': [
'error',
'1tbs',
{
'allowSingleLine': true,
},
],
},
};