-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
73 lines (73 loc) · 1.9 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
73
module.exports = {
env: {
es6: true,
'jest/globals': true,
node: true,
},
extends: ['prettier', 'typescript', 'eslint:recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: [
'prettier',
'import',
'jest',
'sort-keys-fix',
'typescript-sort-keys',
'@typescript-eslint',
],
reportUnusedDisableDirectives: true,
root: true,
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-non-null-assertion': 1,
'@typescript-eslint/no-unused-vars': 1,
eqeqeq: 2,
'import/default': 2,
'import/export': 2,
'import/named': 2,
'import/namespace': 2,
'import/newline-after-import': 2,
'import/no-duplicates': 2,
'import/no-unresolved': 2,
'import/order': 2,
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 0 }],
'no-unused-vars': 'off',
'node/no-missing-import': 'off', // conflicts with typescript absolute imports
'node/no-unsupported-features/es-syntax': 'off',
'node/shebang': 'off',
'prettier/prettier': [
'error',
{
arrowParens: 'always',
printWidth: 80,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
},
],
'security/detect-object-injection': 'off',
'sort-keys-fix/sort-keys-fix': 'warn',
'typescript-sort-keys/interface': 'warn',
},
settings: {
'import/resolver': {
node: { extensions: ['.ts', '.js'] }, // leave this
typescript: {
alwaysTryTypes: true,
},
},
node: {
resolvePaths: ['node_modules/@types'],
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
},
},
};