-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.eslintrc.js
146 lines (143 loc) · 4.18 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
module.exports = {
root: true,
extends: ['./.eslintrc.jest.js', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.eslint.json',
},
env: {
browser: true,
es6: true,
jest: true,
node: true,
},
ignorePatterns: [
'./dist',
'./node_modules',
'webpack.build.config.js',
'webpack.dev.config.js',
'webpack.test.config.js',
],
plugins: ['@typescript-eslint', 'eslint-plugin-node'],
rules: {
// ---> typescript rules
'@typescript-eslint/adjacent-overload-signatures': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-for-in-array': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/triple-slash-reference': ['error', { path: 'never' }],
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNumber: true,
allowBoolean: true,
},
],
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/typedef': [
'error',
{ propertyDeclaration: true, arrowParameter: false, memberVariableDeclaration: false, parameter: false },
],
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/ban-types': [
'error',
{
types: {
Function: 'Use () => void instead',
},
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-redeclare': ['error'],
// --->
// ---> core rules
'spaced-comment': 'off',
'capitalized-comments': 'off',
'comma-dangle': 'off',
complexity: 'off',
curly: 'error',
'default-case': 'off',
'dot-notation': 'off',
'eol-last': 'off',
eqeqeq: 'error',
'guard-for-in': 'error',
indent: 'off',
'linebreak-style': 'off',
'max-classes-per-file': 'off',
'max-lines': 'off',
'newline-per-chained-call': 'off',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-empty': 'off',
'no-empty-functions': 'off',
'no-eval': 'error',
'no-extra-semi': 'off',
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-irregular-whitespace': 'off',
'no-magic-numbers': 'off',
'no-new-wrappers': 'error',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-throw-literal': 'error',
'no-unsafe-finally': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }],
'no-unused-labels': 'warn',
'no-var': 'error',
'no-void': 'off',
'no-undef': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'prefer-const': 'error',
radix: 'warn',
'sort-keys': 'off',
'use-isnan': 'error',
'no-new-func': 'error',
'no-restricted-syntax': [
// casts are NOT ALLOWED!
'error',
"TSAsExpression[typeAnnotation.typeName.name!='const']",
],
// --->
// ---> node rules
'node/no-restricted-import': [
'error',
[
{
name: ['fp-ts', 'fp-ts/**/*'],
message: 'NO FP-TS IN CHART-CORE!!!!!!',
},
{
name: ['../modules/**/*'],
message: "Core modules shouldn't depend on optional modules",
},
],
],
// --->
},
};