-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
116 lines (115 loc) · 2.84 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
// eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires -- CommonJS file
const rules = require('./eslint-rules')
module.exports = {
root: true,
env: {
jest: true,
es2021: true,
'jest/globals': true,
node: true,
},
globals: {
// ECMAScript
ArrayBuffer: 'readonly',
Atomics: 'readonly',
BigInt: 'readonly',
BigInt64Array: 'readonly',
BigUint64Array: 'readonly',
DataView: 'readonly',
Float32Array: 'readonly',
Float64Array: 'readonly',
Int16Array: 'readonly',
Int32Array: 'readonly',
Int8Array: 'readonly',
Map: 'readonly',
Promise: 'readonly',
Proxy: 'readonly',
Reflect: 'readonly',
Set: 'readonly',
SharedArrayBuffer: 'readonly',
Symbol: 'readonly',
Uint16Array: 'readonly',
Uint32Array: 'readonly',
Uint8Array: 'readonly',
Uint8ClampedArray: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
globalThis: 'readonly',
Intl: 'readonly',
// Web Standard
TextDecoder: 'readonly',
TextEncoder: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
WebAssembly: 'readonly',
clearInterval: 'readonly',
clearTimeout: 'readonly',
console: 'readonly',
queueMicrotask: 'readonly',
setInterval: 'readonly',
setTimeout: 'readonly',
// Node.js
Buffer: 'readonly',
GLOBAL: 'readonly',
clearImmediate: 'readonly',
global: 'readonly',
process: 'readonly',
root: 'readonly',
setImmediate: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
exports: 'writable',
module: 'readonly',
require: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
project: ['./tsconfig.eslint.json'],
},
ignorePatterns: ['**/dist/**/*.js', '**/coverage/**/*.js'],
plugins: [
'@typescript-eslint/eslint-plugin',
'import',
'unused-imports',
'prettier',
'filenames',
'jest',
'node',
'eslint-comments',
],
rules,
overrides: [
{
files: ['**/__test__/**/*.spec.ts', '**/__test__/**/*.e2e-spec.ts'],
rules: {
...rules,
// In unit tests, sometimes we want to access private/protected properties for testing
'@typescript-eslint/dot-notation': [
'error',
{
allowPrivateClassPropertyAccess: true,
allowProtectedClassPropertyAccess: true,
allowIndexSignaturePropertyAccess: true,
},
],
},
},
{
files: [
'*.controller.ts',
'*.module.ts',
'*.service.ts',
'*.filter.ts',
'*.middleware.ts',
'*.interceptor.ts',
'*.guard.ts',
],
rules: {
// Conflict with nest's core mechanism
'class-methods-use-this': 'off',
},
},
],
}