-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
126 lines (125 loc) · 4.14 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
module.exports = {
env: {
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
project: './tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import', 'simple-import-sort'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['error'],
"camelcase": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": false
}
}
],
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
'public-constructor',
'protected-constructor',
'private-constructor',
'protected-static-method',
'private-static-method',
'public-instance-method',
'protected-instance-method',
'private-instance-method',
'public-static-method',
],
},
],
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/typedef': [
'error',
{
arrayDestructuring: false,
arrowParameter: false,
memberVariableDeclaration: false,
objectDescructuring: false,
parameter: true,
properpertyDeclaration: false,
variableDeclaration: false,
},
],
curly: 'error',
'default-case': 'error',
'dot-notation': 'error',
eqeqeq: 'error',
'import/no-extraneous-dependencies': [
'error',
{
peerDependencies: true,
},
],
'max-classes-per-file': ['error', 1],
'no-caller': 'error',
'no-console': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-fallthrough': 'error',
'no-new-wrappers': 'error',
'no-redeclare': 'error',
'no-restricted-imports': [
'error',
{
name: 'moment',
message:
'moment is too large and hurts performance. Please use date-fns instead. https://medium.com/@k2u4yt/momentjs-vs-date-fns-6bddc7bfa21e',
},
],
'no-undef-init': 'error',
'no-unused-expressions': 'error',
'no-var': 'error',
radix: ['error', 'as-needed'],
'simple-import-sort/imports': [
'error',
{
/**
* Data Dog config file, i.e "dd"
* React imports, i.e "react"
* Non-scoped packages starting with a word, "i.e lodash"
* Scoped packages, i.e "@nest/core"
* Absolute imports, i.e "../AppModule"
* Absolute imports (siblings), i.e "./interfaces"
*/
groups: [['\\/dd$', 'reflect-metadata$'], ['^react$'], ['^\\w'], ['^@\\w'], ['^\\..\\/'], ['^\\.\\/']],
},
],
'no-redeclare': 'off',
'sort-imports': 'off',
'import/order': 'off',
},
};