@cto.af/eslint-config 3.0.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +60 -1
- package/all.js +13 -0
- package/allModule.js +6 -0
- package/ava.js +13 -53
- package/es6.js +7 -0
- package/globals.js +3 -0
- package/ignores.js +9 -0
- package/index.js +6 -392
- package/js.js +23 -0
- package/jsdoc.js +12 -75
- package/jsdoc_ts.js +12 -0
- package/markdown.js +35 -0
- package/mjs.js +11 -0
- package/module.js +8 -0
- package/package.json +28 -24
- package/rules/ava.js +44 -0
- package/rules/js.js +392 -0
- package/rules/jsdoc.js +69 -0
- package/rules/ts.js +205 -0
- package/ts.js +13 -220
- package/modules.js +0 -32
- package/typescript.js +0 -17
package/rules/ts.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* eslint-disable capitalized-comments */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
rules: {
|
|
6
|
+
// Check: @typescript-eslint
|
|
7
|
+
|
|
8
|
+
// [@typescript-eslint/eslint-recommended](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts)
|
|
9
|
+
'constructor-super': 'off', // ts(2335) & ts(2377)
|
|
10
|
+
'getter-return': 'off', // ts(2378)
|
|
11
|
+
'no-const-assign': 'off', // ts(2588)
|
|
12
|
+
'no-dupe-args': 'off', // ts(2300)
|
|
13
|
+
'no-dupe-class-members': 'off', // ts(2393) & ts(2300)
|
|
14
|
+
'no-dupe-keys': 'off', // ts(1117)
|
|
15
|
+
'no-func-assign': 'off', // ts(2630)
|
|
16
|
+
'no-import-assign': 'off', // ts(2632) & ts(2540)
|
|
17
|
+
'no-new-symbol': 'off', // ts(7009)
|
|
18
|
+
'no-obj-calls': 'off', // ts(2349)
|
|
19
|
+
'no-redeclare': 'off', // ts(2451)
|
|
20
|
+
'no-setter-return': 'off', // ts(2408)
|
|
21
|
+
'no-this-before-super': 'off', // ts(2376) & ts(17009)
|
|
22
|
+
'no-undef': 'off', // ts(2304) & ts(2552)
|
|
23
|
+
'no-unreachable': 'off', // ts(7027)
|
|
24
|
+
'no-unsafe-negation': 'off', // ts(2365) & ts(2322) & ts(2358)
|
|
25
|
+
'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more
|
|
26
|
+
'prefer-const': 'error', // ts provides better types with const
|
|
27
|
+
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
|
|
28
|
+
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
|
|
29
|
+
|
|
30
|
+
// [original disabled for extension](https://typescript-eslint.io/rules/?=extension#extension-rules)
|
|
31
|
+
'class-methods-use-this': 'off',
|
|
32
|
+
'consistent-return': 'off',
|
|
33
|
+
'default-param-last': 'off',
|
|
34
|
+
'dot-notation': 'off',
|
|
35
|
+
'init-declarations': 'off',
|
|
36
|
+
'max-params': 'off',
|
|
37
|
+
'no-array-constructor': 'off',
|
|
38
|
+
// 'no-dupe-class-members': 'off',
|
|
39
|
+
'no-empty-function': 'off',
|
|
40
|
+
'no-implied-eval': 'off',
|
|
41
|
+
'no-invalid-this': 'off',
|
|
42
|
+
'no-loop-func': 'off',
|
|
43
|
+
'no-loss-of-precision': 'off',
|
|
44
|
+
// 'no-magic-numbers': 'off',
|
|
45
|
+
'no-shadow': 'off',
|
|
46
|
+
'no-throw-literal': 'off',
|
|
47
|
+
'no-unused-expressions': 'off',
|
|
48
|
+
'no-unused-vars': 'off',
|
|
49
|
+
'no-use-before-define': 'off',
|
|
50
|
+
'no-useless-constructor': 'off',
|
|
51
|
+
'prefer-destructuring': 'off',
|
|
52
|
+
'prefer-promise-reject-errors': 'off',
|
|
53
|
+
'require-await': 'off',
|
|
54
|
+
|
|
55
|
+
// [typescript-eslint](https://typescript-eslint.io/rules/)
|
|
56
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
57
|
+
'@typescript-eslint/array-type': 'error',
|
|
58
|
+
'@typescript-eslint/await-thenable': 'off', // Can't config
|
|
59
|
+
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
60
|
+
'ts-expect-error': 'allow-with-description',
|
|
61
|
+
}],
|
|
62
|
+
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
63
|
+
'@typescript-eslint/ban-types': 'off', // Not needed
|
|
64
|
+
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
|
|
65
|
+
'@typescript-eslint/class-methods-use-this': 'error',
|
|
66
|
+
'@typescript-eslint/consistent-generic-constructors': [
|
|
67
|
+
'error',
|
|
68
|
+
'constructor',
|
|
69
|
+
],
|
|
70
|
+
'@typescript-eslint/consistent-indexed-object-style': [
|
|
71
|
+
'error',
|
|
72
|
+
'index-signature',
|
|
73
|
+
],
|
|
74
|
+
'@typescript-eslint/consistent-return': 'error',
|
|
75
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
76
|
+
'error',
|
|
77
|
+
{assertionStyle: 'as', objectLiteralTypeAssertions: 'allow'},
|
|
78
|
+
],
|
|
79
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
80
|
+
'@typescript-eslint/consistent-type-exports': 'off', // Can't config
|
|
81
|
+
'@typescript-eslint/consistent-type-imports': 'off', // Can't do mixed
|
|
82
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
83
|
+
'@typescript-eslint/dot-notation': ['error', {
|
|
84
|
+
allowIndexSignaturePropertyAccess: true,
|
|
85
|
+
}],
|
|
86
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
87
|
+
'@typescript-eslint/explicit-member-accessibility': 'error',
|
|
88
|
+
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
89
|
+
'@typescript-eslint/init-declarations': 'error',
|
|
90
|
+
'@typescript-eslint/max-params': ['error', {max: 4}],
|
|
91
|
+
'@typescript-eslint/member-ordering': 'error',
|
|
92
|
+
'@typescript-eslint/method-signature-style': ['error', 'method'],
|
|
93
|
+
'@typescript-eslint/naming-convention': 'off', // Too late
|
|
94
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
95
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
96
|
+
'@typescript-eslint/no-base-to-string': 'off', // Can't config
|
|
97
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
98
|
+
'@typescript-eslint/no-confusing-void-expression': 'off', // Can't config
|
|
99
|
+
'@typescript-eslint/no-dupe-class-members': 'off', // Not recommended
|
|
100
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
101
|
+
'@typescript-eslint/no-duplicate-type-constituents': 'error',
|
|
102
|
+
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
103
|
+
'@typescript-eslint/no-empty-function': 'error',
|
|
104
|
+
'@typescript-eslint/no-empty-interface': 'error',
|
|
105
|
+
'@typescript-eslint/no-explicit-any': 'off', // Too hard
|
|
106
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
107
|
+
'@typescript-eslint/no-extraneous-class': 'error',
|
|
108
|
+
'@typescript-eslint/no-floating-promises': 'off', // Can't config
|
|
109
|
+
'@typescript-eslint/no-for-in-array': 'error',
|
|
110
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
111
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
112
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
113
|
+
'@typescript-eslint/no-invalid-this': 'error',
|
|
114
|
+
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
115
|
+
'@typescript-eslint/no-loop-func': 'error',
|
|
116
|
+
'@typescript-eslint/no-loss-of-precision': 'error',
|
|
117
|
+
'@typescript-eslint/no-magic-numbers': 'off', // Too late
|
|
118
|
+
'@typescript-eslint/no-meaningless-void-operator': 'off', // Can't config
|
|
119
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
120
|
+
'@typescript-eslint/no-misused-promises': 'off', // Can't config
|
|
121
|
+
'@typescript-eslint/no-mixed-enums': 'error',
|
|
122
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
123
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
124
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
125
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
126
|
+
'@typescript-eslint/no-redeclare': 'off', // Not recommended
|
|
127
|
+
'@typescript-eslint/no-redundant-type-constituents': 'off', // Can't config
|
|
128
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
129
|
+
'@typescript-eslint/no-restricted-imports': 'off', // Not needed
|
|
130
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
131
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
132
|
+
'@typescript-eslint/no-throw-literal': 'error',
|
|
133
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // Can't config
|
|
134
|
+
'@typescript-eslint/no-unnecessary-condition': 'off', // Can't config
|
|
135
|
+
'@typescript-eslint/no-unnecessary-qualifier': 'off', // Can't config
|
|
136
|
+
'@typescript-eslint/no-unnecessary-type-arguments': 'off', // Can't config
|
|
137
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // Can't config
|
|
138
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
139
|
+
'@typescript-eslint/no-unsafe-argument': 'off', // Can't config
|
|
140
|
+
'@typescript-eslint/no-unsafe-assignment': 'off', // Can't config
|
|
141
|
+
'@typescript-eslint/no-unsafe-call': 'off', // Can't config
|
|
142
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
143
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
144
|
+
'@typescript-eslint/no-unsafe-member-access': 'off', // Can't config
|
|
145
|
+
'@typescript-eslint/no-unsafe-return': 'off', // Can't config
|
|
146
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
147
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
148
|
+
'@typescript-eslint/no-unused-vars': [
|
|
149
|
+
'error', {
|
|
150
|
+
args: 'none',
|
|
151
|
+
argsIgnorePattern: '^_',
|
|
152
|
+
caughtErrors: 'all',
|
|
153
|
+
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
154
|
+
varsIgnorePattern: '^_',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
'@typescript-eslint/no-use-before-define': 'error',
|
|
158
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
159
|
+
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
160
|
+
'@typescript-eslint/no-useless-template-literals': 'error',
|
|
161
|
+
'@typescript-eslint/no-var-requires': 'error',
|
|
162
|
+
'@typescript-eslint/non-nullable-type-assertion-style': 'off', // Can't config
|
|
163
|
+
'@typescript-eslint/parameter-properties': 'error',
|
|
164
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
165
|
+
'@typescript-eslint/prefer-destructuring': 'error',
|
|
166
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
167
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
168
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
169
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
170
|
+
'@typescript-eslint/prefer-includes': 'off', // Can't config
|
|
171
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
172
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
173
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off', // Can't config
|
|
174
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
175
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'error',
|
|
176
|
+
'@typescript-eslint/prefer-readonly': 'off', // Can't config
|
|
177
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off', // Can't config
|
|
178
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'off', // Can't config
|
|
179
|
+
'@typescript-eslint/prefer-regexp-exec': 'off', // Can't config
|
|
180
|
+
'@typescript-eslint/prefer-return-this-type': 'off', // Can't config
|
|
181
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'off', // Can't config
|
|
182
|
+
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
183
|
+
'@typescript-eslint/promise-function-async': 'off', // Can't config
|
|
184
|
+
'@typescript-eslint/require-array-sort-compare': 'off', // Can't config
|
|
185
|
+
'@typescript-eslint/require-await': 'error',
|
|
186
|
+
'@typescript-eslint/restrict-plus-operands': 'off', // Can't config
|
|
187
|
+
'@typescript-eslint/restrict-template-expressions': 'off', // Can't config
|
|
188
|
+
'@typescript-eslint/return-await': 'error',
|
|
189
|
+
'@typescript-eslint/sort-type-constituents': 'error',
|
|
190
|
+
'@typescript-eslint/strict-boolean-expressions': 'off', // Can't config
|
|
191
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'off', // Can't config
|
|
192
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
193
|
+
'@typescript-eslint/typedef': 'error',
|
|
194
|
+
'@typescript-eslint/unbound-method': 'off', // Can't config
|
|
195
|
+
'@typescript-eslint/unified-signatures': 'off', // Too hard
|
|
196
|
+
|
|
197
|
+
// These are the stylistic rules that require TS. All of the
|
|
198
|
+
// others from the JS rules should work as-is.
|
|
199
|
+
// [Stylistc](https://eslint.style/packages/default)
|
|
200
|
+
'@stylistic/member-delimiter-style': 'error',
|
|
201
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
202
|
+
'@stylistic/type-generic-spacing': 'error',
|
|
203
|
+
'@stylistic/type-named-tuple-spacing': 'error',
|
|
204
|
+
},
|
|
205
|
+
};
|
package/ts.js
CHANGED
|
@@ -1,223 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const {rules} = require('./rules/ts.js');
|
|
4
|
+
const tslint = require('typescript-eslint');
|
|
5
5
|
|
|
6
|
-
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'no-dupe-args': 'off',
|
|
18
|
-
'no-dupe-class-members': 'off',
|
|
19
|
-
'no-dupe-keys': 'off',
|
|
20
|
-
'no-func-assign': 'off',
|
|
21
|
-
'no-import-assign': 'off',
|
|
22
|
-
'no-new-symbol': 'off',
|
|
23
|
-
'no-obj-calls': 'off',
|
|
24
|
-
'no-redeclare': 'off',
|
|
25
|
-
'no-setter-return': 'off',
|
|
26
|
-
'no-this-before-super': 'off',
|
|
27
|
-
'no-undef': 'off',
|
|
28
|
-
'no-unreachable': 'off',
|
|
29
|
-
'no-unsafe-negation': 'off',
|
|
30
|
-
'no-var': 'error',
|
|
31
|
-
'prefer-const': 'error',
|
|
32
|
-
'prefer-rest-params': 'error',
|
|
33
|
-
'prefer-spread': 'error',
|
|
34
|
-
'valid-typeof': 'off',
|
|
35
|
-
|
|
36
|
-
// For all of these that have a non-plugin "off" to go with them,
|
|
37
|
-
// the typescript-eslint plugin provides a superset of the original
|
|
38
|
-
// rule.
|
|
39
|
-
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
40
|
-
'@typescript-eslint/array-type': 'error',
|
|
41
|
-
'@typescript-eslint/await-thenable': 'off', // Can't config
|
|
42
|
-
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
43
|
-
'ts-expect-error': 'allow-with-description',
|
|
44
|
-
}],
|
|
45
|
-
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
46
|
-
'@typescript-eslint/ban-types': 'off', // Not needed
|
|
47
|
-
'@typescript-eslint/block-spacing': 'error',
|
|
48
|
-
'brace-style': 'off',
|
|
49
|
-
'@typescript-eslint/brace-style': ['error', '1tbs', {
|
|
50
|
-
allowSingleLine: true,
|
|
51
|
-
}],
|
|
52
|
-
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
|
|
53
|
-
'class-methods-use-this': 'off',
|
|
54
|
-
'@typescript-eslint/class-methods-use-this': 'error',
|
|
55
|
-
'comma-dangle': 'off',
|
|
56
|
-
'@typescript-eslint/comma-dangle': [
|
|
57
|
-
'error',
|
|
58
|
-
{
|
|
59
|
-
arrays: 'always-multiline',
|
|
60
|
-
objects: 'always-multiline',
|
|
61
|
-
imports: 'always-multiline',
|
|
62
|
-
exports: 'always-multiline',
|
|
63
|
-
functions: 'never',
|
|
64
|
-
enums: 'always-multiline',
|
|
65
|
-
generics: 'never',
|
|
66
|
-
tuples: 'always-multiline',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
'comma-spacing': 'off',
|
|
70
|
-
'@typescript-eslint/comma-spacing': 'error',
|
|
71
|
-
'default-param-last': 'off',
|
|
72
|
-
'@typescript-eslint/consistent-generic-constructors': [
|
|
73
|
-
'error',
|
|
74
|
-
'constructor',
|
|
75
|
-
],
|
|
76
|
-
'@typescript-eslint/consistent-indexed-object-style': [
|
|
77
|
-
'error',
|
|
78
|
-
'index-signature',
|
|
79
|
-
],
|
|
80
|
-
'@typescript-eslint/consistent-type-assertions': [
|
|
81
|
-
'error',
|
|
82
|
-
{assertionStyle: 'as', objectLiteralTypeAssertions: 'allow'},
|
|
83
|
-
],
|
|
84
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
85
|
-
'@typescript-eslint/consistent-type-exports': 'off', // Can't config
|
|
86
|
-
'@typescript-eslint/consistent-type-imports': 'off', // Can't do mixed
|
|
87
|
-
'@typescript-eslint/default-param-last': 'error',
|
|
88
|
-
'@typescript-eslint/dot-notation': 'off', // Can't config
|
|
89
|
-
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
90
|
-
'@typescript-eslint/explicit-member-accessibility': 'error',
|
|
91
|
-
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
92
|
-
'func-call-spacing': 'off',
|
|
93
|
-
'@typescript-eslint/func-call-spacing': 'error',
|
|
94
|
-
'@typescript-eslint/indent': ['off', 2], // Broken, see https://github.com/typescript-eslint/typescript-eslint/issues/1824
|
|
95
|
-
'@typescript-eslint/init-declarations': 'error',
|
|
96
|
-
'@typescript-eslint/key-spacing': ['error', {mode: 'minimum'}],
|
|
97
|
-
'@typescript-eslint/keyword-spacing': 'error',
|
|
98
|
-
'@typescript-eslint/lines-around-comment': 'off', // Maybe later
|
|
99
|
-
'@typescript-eslint/lines-between-class-members': 'error',
|
|
100
|
-
'max-params': 'off',
|
|
101
|
-
'@typescript-eslint/max-params': ['error', {max: 4}],
|
|
102
|
-
'@typescript-eslint/member-delimiter-style': 'error',
|
|
103
|
-
'@typescript-eslint/member-ordering': 'error',
|
|
104
|
-
'@typescript-eslint/method-signature-style': ['error', 'method'],
|
|
105
|
-
'@typescript-eslint/naming-convention': 'off', // Too late
|
|
106
|
-
'no-array-constructor': 'off',
|
|
107
|
-
'@typescript-eslint/no-array-constructor': 'error',
|
|
108
|
-
'@typescript-eslint/no-base-to-string': 'off', // Can't config
|
|
109
|
-
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
110
|
-
'@typescript-eslint/no-confusing-void-expression': 'off', // Can't config
|
|
111
|
-
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
112
|
-
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
113
|
-
'@typescript-eslint/no-duplicate-type-constituents': 'error',
|
|
114
|
-
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
115
|
-
'no-empty-function': 'off',
|
|
116
|
-
'@typescript-eslint/no-empty-function': 'error',
|
|
117
|
-
'@typescript-eslint/no-empty-interface': 'error',
|
|
118
|
-
'@typescript-eslint/no-explicit-any': 'off', // Too hard
|
|
119
|
-
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
120
|
-
'@typescript-eslint/no-extra-parens': 'off', // Disagree
|
|
121
|
-
'no-extra-semi': 'off',
|
|
122
|
-
'@typescript-eslint/no-extra-semi': 'error',
|
|
123
|
-
'@typescript-eslint/no-extraneous-class': 'error',
|
|
124
|
-
'@typescript-eslint/no-floating-promises': 'off', // Can't config
|
|
125
|
-
'@typescript-eslint/no-for-in-array': 'error',
|
|
126
|
-
'@typescript-eslint/no-implied-eval': 'off', // Can't config
|
|
127
|
-
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
128
|
-
'@typescript-eslint/no-inferrable-types': 'error',
|
|
129
|
-
'@typescript-eslint/no-invalid-this': 'error',
|
|
130
|
-
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
131
|
-
'no-loop-func': 'off',
|
|
132
|
-
'@typescript-eslint/no-loop-func': 'error',
|
|
133
|
-
'@typescript-eslint/no-loss-of-precision': 'error',
|
|
134
|
-
'@typescript-eslint/no-magic-numbers': 'off', // Too late
|
|
135
|
-
'@typescript-eslint/no-meaningless-void-operator': 'off', // Can't config
|
|
136
|
-
'@typescript-eslint/no-misused-new': 'error',
|
|
137
|
-
'@typescript-eslint/no-misused-promises': 'off', // Can't config
|
|
138
|
-
'@typescript-eslint/no-mixed-enums': 'error',
|
|
139
|
-
'@typescript-eslint/no-namespace': 'error',
|
|
140
|
-
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
141
|
-
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
142
|
-
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
143
|
-
'@typescript-eslint/no-redeclare': 'error',
|
|
144
|
-
'@typescript-eslint/no-redundant-type-constituents': 'off', // Can't config
|
|
145
|
-
'@typescript-eslint/no-require-imports': 'error',
|
|
146
|
-
'@typescript-eslint/no-restricted-imports': 'off', // Not needed
|
|
147
|
-
'@typescript-eslint/no-shadow': 'error',
|
|
148
|
-
'@typescript-eslint/no-this-alias': 'error',
|
|
149
|
-
'@typescript-eslint/no-throw-literal': 'off', // Can't config
|
|
150
|
-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // Can't config
|
|
151
|
-
'@typescript-eslint/no-unnecessary-condition': 'off', // Can't config
|
|
152
|
-
'@typescript-eslint/no-unnecessary-qualifier': 'off', // Can't config
|
|
153
|
-
'@typescript-eslint/no-unnecessary-type-arguments': 'off', // Can't config
|
|
154
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // Can't config
|
|
155
|
-
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
156
|
-
'@typescript-eslint/no-unsafe-argument': 'off', // Can't config
|
|
157
|
-
'@typescript-eslint/no-unsafe-assignment': 'off', // Can't config
|
|
158
|
-
'@typescript-eslint/no-unsafe-call': 'off', // Can't config
|
|
159
|
-
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
160
|
-
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
161
|
-
'@typescript-eslint/no-unsafe-member-access': 'off', // Can't config
|
|
162
|
-
'@typescript-eslint/no-unsafe-return': 'off', // Can't config
|
|
163
|
-
'@typescript-eslint/no-unused-expressions': 'error',
|
|
164
|
-
'no-unused-vars': 'off',
|
|
165
|
-
'@typescript-eslint/no-unused-vars': [
|
|
166
|
-
'error', {
|
|
167
|
-
args: 'none',
|
|
168
|
-
caughtErrors: 'all',
|
|
169
|
-
caughtErrorsIgnorePattern: '^(ignore|_)',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
'@typescript-eslint/no-use-before-define': 'error',
|
|
173
|
-
'@typescript-eslint/no-useless-constructor': 'error',
|
|
174
|
-
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
175
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
176
|
-
'@typescript-eslint/non-nullable-type-assertion-style': 'off', // Can't config
|
|
177
|
-
'object-curly-spacing': 'off',
|
|
178
|
-
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
|
179
|
-
'@typescript-eslint/padding-line-between-statements': 'error',
|
|
180
|
-
'@typescript-eslint/parameter-properties': 'error',
|
|
181
|
-
'@typescript-eslint/prefer-as-const': 'error',
|
|
182
|
-
'prefer-destructuring': 'off',
|
|
183
|
-
'@typescript-eslint/prefer-destructuring': 'error',
|
|
184
|
-
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
185
|
-
'@typescript-eslint/prefer-for-of': 'error',
|
|
186
|
-
'@typescript-eslint/prefer-function-type': 'error',
|
|
187
|
-
'@typescript-eslint/prefer-includes': 'off', // Can't config
|
|
188
|
-
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
189
|
-
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
190
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'off', // Can't config
|
|
191
|
-
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
192
|
-
'@typescript-eslint/prefer-readonly-parameter-types': 'off', // Can't config
|
|
193
|
-
'@typescript-eslint/prefer-readonly': 'off', // Can't config
|
|
194
|
-
'@typescript-eslint/prefer-reduce-type-parameter': 'off', // Can't config
|
|
195
|
-
'@typescript-eslint/prefer-regexp-exec': 'off', // Can't config
|
|
196
|
-
'@typescript-eslint/prefer-return-this-type': 'off', // Can't config
|
|
197
|
-
'@typescript-eslint/prefer-string-starts-ends-with': 'off', // Can't config
|
|
198
|
-
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
199
|
-
'@typescript-eslint/promise-function-async': 'off', // Can't config
|
|
200
|
-
'quotes': 'off',
|
|
201
|
-
'@typescript-eslint/quotes': ['error', 'single', {avoidEscape: true}],
|
|
202
|
-
'@typescript-eslint/require-array-sort-compare': 'off', // Can't config
|
|
203
|
-
'@typescript-eslint/require-await': 'off', // Can't config
|
|
204
|
-
'@typescript-eslint/restrict-plus-operands': 'off', // Can't config
|
|
205
|
-
'@typescript-eslint/restrict-template-expressions': 'off', // Can't config
|
|
206
|
-
'@typescript-eslint/return-await': 'off', // Can't config
|
|
207
|
-
'semi': 'off',
|
|
208
|
-
'@typescript-eslint/semi': ['error', 'always'],
|
|
209
|
-
'@typescript-eslint/sort-type-constituents': 'error',
|
|
210
|
-
'@typescript-eslint/space-before-blocks': 'error',
|
|
211
|
-
'space-before-function-paren': 'off',
|
|
212
|
-
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
|
|
213
|
-
'space-infix-ops': 'off',
|
|
214
|
-
'@typescript-eslint/space-infix-ops': ['error', {int32Hint: true}],
|
|
215
|
-
'@typescript-eslint/strict-boolean-expressions': 'off', // Can't config
|
|
216
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'off', // Can't config
|
|
217
|
-
'@typescript-eslint/triple-slash-reference': 'error',
|
|
218
|
-
'@typescript-eslint/type-annotation-spacing': 'error',
|
|
219
|
-
'@typescript-eslint/typedef': 'error',
|
|
220
|
-
'@typescript-eslint/unbound-method': 'off', // Can't config
|
|
221
|
-
'@typescript-eslint/unified-signatures': 'off', // Too hard
|
|
222
|
-
},
|
|
223
|
-
};
|
|
6
|
+
module.exports = [{
|
|
7
|
+
files: ['**/*.ts'],
|
|
8
|
+
ignores: [
|
|
9
|
+
'coverage/**',
|
|
10
|
+
'node_modules/**',
|
|
11
|
+
'docs/**',
|
|
12
|
+
],
|
|
13
|
+
...tslint.configs.base,
|
|
14
|
+
rules,
|
|
15
|
+
}];
|
|
16
|
+
module.exports[0].languageOptions.parserOptions.project = true;
|
package/modules.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Use this in type="modules" projects
|
|
4
|
-
|
|
5
|
-
// module.exports = {
|
|
6
|
-
// extends: '@cto.af/eslint-config/modules'
|
|
7
|
-
// }
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
extends: [
|
|
11
|
-
'./index.js',
|
|
12
|
-
],
|
|
13
|
-
overrides: [
|
|
14
|
-
{
|
|
15
|
-
files: ['*.js'],
|
|
16
|
-
parserOptions: {
|
|
17
|
-
sourceType: 'module',
|
|
18
|
-
ecmaVersion: '2021',
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
// [Possible Errors](https://eslint.org/docs/rules/#possible-errors)
|
|
22
|
-
'n/no-unsupported-features/es-syntax': [
|
|
23
|
-
'error',
|
|
24
|
-
{
|
|
25
|
-
version: '>=16',
|
|
26
|
-
ignores: ['modules'],
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
};
|
package/typescript.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
// Use this in typescript projects
|
|
3
|
-
|
|
4
|
-
// module.exports = {
|
|
5
|
-
// extends: '@cto.af/eslint-config/typescript'
|
|
6
|
-
// }
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
overrides: [
|
|
10
|
-
{
|
|
11
|
-
files: ['*.ts'],
|
|
12
|
-
extends: [
|
|
13
|
-
'./ts.js',
|
|
14
|
-
],
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
};
|