forked from odavid/typeorm-transactional-cls-hooked
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.eslintrc.js
104 lines (94 loc) · 2.62 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'jest.config.js', 'tests/**'],
rules: {
'@typescript-eslint/member-ordering': ['error'],
indent: 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'linebreak-style': ['error', 'unix'],
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': [
'off',
{ allowTypedFunctionExpressions: true },
],
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: true, variables: true, typedefs: true },
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-redeclare': ['error', { ignoreDeclarationMerge: true }],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: {
accessors: 'no-public',
constructors: 'no-public',
},
},
],
'no-console': ['warn'],
'eol-last': ['error', 'always'],
complexity: ['error', 13],
'max-depth': ['error', 4],
'max-lines': [
'error',
{
max: 300,
skipBlankLines: true,
skipComments: true,
},
],
'max-lines-per-function': [
'error',
{
max: 150,
skipBlankLines: true,
skipComments: true,
IIFEs: true,
},
],
'max-nested-callbacks': ['error', 3],
'max-params': ['error', 5],
'max-statements': ['error', 22],
'max-statements-per-line': 2,
'func-style': ['error', 'expression'],
'@typescript-eslint/unbound-method': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
},
overrides: [
{
files: ['**/*.{spec,test}.{ts,js}'],
rules: {
'max-lines-per-function': 'off',
},
},
],
};