@cto.af/eslint-config 4.1.5 → 5.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/all.js +19 -10
- package/allModule.js +5 -4
- package/ava.js +4 -4
- package/cjs.js +1 -3
- package/es6.js +5 -4
- package/globals.js +1 -3
- package/ignores.js +2 -3
- package/index.js +7 -5
- package/js.js +7 -7
- package/jsdoc.js +4 -4
- package/jsdoc_ts.js +1 -3
- package/json.js +15 -0
- package/markdown.js +2 -3
- package/mjs.js +1 -3
- package/mocha.js +2 -4
- package/module.js +1 -3
- package/package.json +11 -21
- package/rules/ava.js +36 -40
- package/rules/js.js +380 -383
- package/rules/jsdoc.js +67 -70
- package/rules/json.js +5 -0
- package/rules/ts.js +162 -165
- package/ts.js +8 -8
- package/eslint.config.mjs +0 -33
package/rules/jsdoc.js
CHANGED
|
@@ -1,72 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
export const rules = {
|
|
2
|
+
// Check: jsdoc
|
|
3
|
+
// [Stylistic Issues](https://eslint.org/docs/rules/#stylistic-issues)
|
|
2
4
|
|
|
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
|
-
'jsdoc/sort-tags': 'error',
|
|
68
|
-
'jsdoc/tag-lines': 'off',
|
|
69
|
-
'jsdoc/text-escaping': 'off', // Painful
|
|
70
|
-
'jsdoc/valid-types': 'error',
|
|
71
|
-
},
|
|
5
|
+
'jsdoc/check-access': 'error',
|
|
6
|
+
'jsdoc/check-alignment': 'error',
|
|
7
|
+
// https://github.com/eslint/eslint/issues/14745
|
|
8
|
+
'jsdoc/check-examples': 'off',
|
|
9
|
+
'jsdoc/check-indentation': 'off',
|
|
10
|
+
'jsdoc/check-line-alignment': ['error', 'never', {
|
|
11
|
+
wrapIndent: ' ',
|
|
12
|
+
}],
|
|
13
|
+
'jsdoc/check-param-names': 'error',
|
|
14
|
+
'jsdoc/check-property-names': 'error',
|
|
15
|
+
'jsdoc/check-syntax': 'error',
|
|
16
|
+
'jsdoc/check-tag-names': 'error',
|
|
17
|
+
'jsdoc/check-template-names': 'error',
|
|
18
|
+
'jsdoc/check-types': 'error',
|
|
19
|
+
'jsdoc/check-values': 'error',
|
|
20
|
+
'jsdoc/convert-to-jsdoc-comments': 'off', // Seems odd
|
|
21
|
+
'jsdoc/empty-tags': 'error',
|
|
22
|
+
'jsdoc/implements-on-classes': 'error',
|
|
23
|
+
'jsdoc/imports-as-dependencies': 'error',
|
|
24
|
+
'jsdoc/informative-docs': 'off', // This sounds annoying
|
|
25
|
+
'jsdoc/lines-before-block': 'error',
|
|
26
|
+
'jsdoc/match-description': 'error',
|
|
27
|
+
'jsdoc/match-name': 'off',
|
|
28
|
+
'jsdoc/multiline-blocks': 'error',
|
|
29
|
+
'jsdoc/no-bad-blocks': 'error',
|
|
30
|
+
'jsdoc/no-blank-block-descriptions': 'off', // I use blank lines intentionally
|
|
31
|
+
'jsdoc/no-blank-blocks': 'error',
|
|
32
|
+
'jsdoc/no-defaults': 'off',
|
|
33
|
+
'jsdoc/no-missing-syntax': 'off',
|
|
34
|
+
'jsdoc/no-multi-asterisks': 'error',
|
|
35
|
+
'jsdoc/no-restricted-syntax': 'off',
|
|
36
|
+
'jsdoc/no-types': 'off',
|
|
37
|
+
'jsdoc/no-undefined-types': 'off', // Use typedoc
|
|
38
|
+
'jsdoc/require-asterisk-prefix': 'error',
|
|
39
|
+
'jsdoc/require-description': ['error', {exemptedBy: ['inheritdoc', 'private', 'ignore']}],
|
|
40
|
+
'jsdoc/require-description-complete-sentence': 'error',
|
|
41
|
+
'jsdoc/require-example': 'off',
|
|
42
|
+
'jsdoc/require-file-overview': 'off',
|
|
43
|
+
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
|
|
44
|
+
'jsdoc/require-jsdoc': ['error', {
|
|
45
|
+
publicOnly: {ancestorsOnly: true},
|
|
46
|
+
}],
|
|
47
|
+
'jsdoc/require-param': ['error', {exemptedBy: ['inheritdoc', 'private', 'ignore']}],
|
|
48
|
+
'jsdoc/require-param-description': 'error',
|
|
49
|
+
'jsdoc/require-param-name': 'error',
|
|
50
|
+
'jsdoc/require-param-type': 'error',
|
|
51
|
+
'jsdoc/require-property': 'error',
|
|
52
|
+
'jsdoc/require-property-description': 'error',
|
|
53
|
+
'jsdoc/require-property-name': 'error',
|
|
54
|
+
'jsdoc/require-property-type': 'error',
|
|
55
|
+
'jsdoc/require-returns': ['error', {
|
|
56
|
+
exemptedBy: ['ignore'],
|
|
57
|
+
}],
|
|
58
|
+
'jsdoc/require-returns-check': 'error',
|
|
59
|
+
'jsdoc/require-returns-description': 'error',
|
|
60
|
+
'jsdoc/require-returns-type': 'error',
|
|
61
|
+
'jsdoc/require-template': 'error',
|
|
62
|
+
'jsdoc/require-throws': 'error',
|
|
63
|
+
'jsdoc/require-yields': 'error',
|
|
64
|
+
'jsdoc/require-yields-check': 'error',
|
|
65
|
+
'jsdoc/sort-tags': 'error',
|
|
66
|
+
'jsdoc/tag-lines': 'off',
|
|
67
|
+
'jsdoc/text-escaping': 'off', // Painful
|
|
68
|
+
'jsdoc/valid-types': 'error',
|
|
72
69
|
};
|
package/rules/json.js
ADDED
package/rules/ts.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
'use
|
|
2
|
-
|
|
3
|
-
const {builtinRules} = require('eslint/use-at-your-own-risk');
|
|
4
|
-
const ts = require('typescript-eslint');
|
|
1
|
+
import {builtinRules} from 'eslint/use-at-your-own-risk';
|
|
2
|
+
import ts from 'typescript-eslint';
|
|
5
3
|
|
|
6
4
|
const originalDisabled = {};
|
|
7
5
|
builtinRules.forEach((_, r) => {
|
|
@@ -12,168 +10,167 @@ builtinRules.forEach((_, r) => {
|
|
|
12
10
|
|
|
13
11
|
/* eslint meta/no-unused-rules: ["error", {ignore: ["@stylistic"]}] */
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
rules
|
|
17
|
-
|
|
18
|
-
...originalDisabled,
|
|
13
|
+
export const rules = {
|
|
14
|
+
// [original disabled for extension](https://typescript-eslint.io/rules/?=extension#extension-rules)
|
|
15
|
+
...originalDisabled,
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// [@typescript-eslint/eslint-recommended](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts)
|
|
18
|
+
...ts.configs.eslintRecommended.rules,
|
|
22
19
|
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
20
|
+
// [typescript-eslint](https://typescript-eslint.io/rules/)
|
|
21
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
22
|
+
'@typescript-eslint/array-type': 'error',
|
|
23
|
+
'@typescript-eslint/await-thenable': 'off', // Can't config
|
|
24
|
+
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
25
|
+
'ts-expect-error': 'allow-with-description',
|
|
26
|
+
'ts-ignore': true,
|
|
27
|
+
'ts-nocheck': true,
|
|
28
|
+
'ts-check': false,
|
|
29
|
+
'minimumDescriptionLength': 3,
|
|
30
|
+
}],
|
|
31
|
+
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
32
|
+
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
|
|
33
|
+
'@typescript-eslint/class-methods-use-this': 'error',
|
|
34
|
+
'@typescript-eslint/consistent-generic-constructors': [
|
|
35
|
+
'error',
|
|
36
|
+
'constructor',
|
|
37
|
+
],
|
|
38
|
+
'@typescript-eslint/consistent-indexed-object-style': [
|
|
39
|
+
'error',
|
|
40
|
+
'index-signature',
|
|
41
|
+
],
|
|
42
|
+
'@typescript-eslint/consistent-return': 'error',
|
|
43
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
44
|
+
'error',
|
|
45
|
+
{assertionStyle: 'as', objectLiteralTypeAssertions: 'allow'},
|
|
46
|
+
],
|
|
47
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
48
|
+
'@typescript-eslint/consistent-type-exports': 'off', // Can't config
|
|
49
|
+
'@typescript-eslint/consistent-type-imports': 'off', // Can't do mixed
|
|
50
|
+
'@typescript-eslint/default-param-last': 'error',
|
|
51
|
+
'@typescript-eslint/dot-notation': ['error', {
|
|
52
|
+
allowIndexSignaturePropertyAccess: true,
|
|
53
|
+
}],
|
|
54
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
55
|
+
'@typescript-eslint/explicit-member-accessibility': 'error',
|
|
56
|
+
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
57
|
+
'@typescript-eslint/init-declarations': 'error',
|
|
58
|
+
'@typescript-eslint/max-params': ['error', {max: 4}],
|
|
59
|
+
'@typescript-eslint/member-ordering': 'error',
|
|
60
|
+
'@typescript-eslint/method-signature-style': ['error', 'method'],
|
|
61
|
+
'@typescript-eslint/naming-convention': 'off', // Too late
|
|
62
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
63
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
64
|
+
'@typescript-eslint/no-base-to-string': 'off', // Can't config
|
|
65
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
66
|
+
'@typescript-eslint/no-confusing-void-expression': 'off', // Can't config
|
|
67
|
+
'@typescript-eslint/no-deprecated': 'error', // See how this works in practce.
|
|
68
|
+
'@typescript-eslint/no-dupe-class-members': 'off', // Not recommended
|
|
69
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
70
|
+
'@typescript-eslint/no-duplicate-type-constituents': 'error',
|
|
71
|
+
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
72
|
+
'@typescript-eslint/no-empty-function': 'error',
|
|
73
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
74
|
+
'@typescript-eslint/no-explicit-any': 'off', // Too hard
|
|
75
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
76
|
+
'@typescript-eslint/no-extraneous-class': 'error',
|
|
77
|
+
'@typescript-eslint/no-floating-promises': 'off', // Can't config
|
|
78
|
+
'@typescript-eslint/no-for-in-array': 'error',
|
|
79
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
80
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
81
|
+
'@typescript-eslint/no-inferrable-types': 'error',
|
|
82
|
+
'@typescript-eslint/no-invalid-this': 'error',
|
|
83
|
+
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
84
|
+
'@typescript-eslint/no-loop-func': 'error',
|
|
85
|
+
'@typescript-eslint/no-magic-numbers': 'off', // Too late
|
|
86
|
+
'@typescript-eslint/no-meaningless-void-operator': 'off', // Can't config
|
|
87
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
88
|
+
'@typescript-eslint/no-misused-promises': 'off', // Can't config
|
|
89
|
+
'@typescript-eslint/no-mixed-enums': 'error',
|
|
90
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
91
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
92
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
93
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
94
|
+
'@typescript-eslint/no-redeclare': 'off', // Not recommended
|
|
95
|
+
'@typescript-eslint/no-redundant-type-constituents': 'off', // Can't config
|
|
96
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
97
|
+
'@typescript-eslint/no-restricted-imports': 'off', // Not needed
|
|
98
|
+
'@typescript-eslint/no-restricted-types': 'off', // Not needed
|
|
99
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
100
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
101
|
+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // Can't config
|
|
102
|
+
'@typescript-eslint/no-unnecessary-condition': 'off', // Can't config
|
|
103
|
+
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
|
|
104
|
+
'@typescript-eslint/no-unnecessary-qualifier': 'off', // Can't config
|
|
105
|
+
'@typescript-eslint/no-unnecessary-template-expression': 'error',
|
|
106
|
+
'@typescript-eslint/no-unnecessary-type-arguments': 'off', // Can't config
|
|
107
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // Can't config
|
|
108
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
109
|
+
'@typescript-eslint/no-unnecessary-type-parameters': 'error', // Warning: preliminary
|
|
110
|
+
'@typescript-eslint/no-unsafe-argument': 'off', // Can't config
|
|
111
|
+
'@typescript-eslint/no-unsafe-assignment': 'off', // Can't config
|
|
112
|
+
'@typescript-eslint/no-unsafe-call': 'off', // Can't config
|
|
113
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
114
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
115
|
+
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
116
|
+
'@typescript-eslint/no-unsafe-member-access': 'off', // Can't config
|
|
117
|
+
'@typescript-eslint/no-unsafe-return': 'off', // Can't config
|
|
118
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
119
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
120
|
+
'@typescript-eslint/no-unused-vars': [
|
|
121
|
+
'error', {
|
|
122
|
+
args: 'all',
|
|
123
|
+
argsIgnorePattern: '^_',
|
|
124
|
+
caughtErrors: 'all',
|
|
125
|
+
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
126
|
+
varsIgnorePattern: '^_[^_]',
|
|
127
|
+
reportUsedIgnorePattern: true,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
'@typescript-eslint/no-use-before-define': 'error',
|
|
131
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
132
|
+
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
133
|
+
'@typescript-eslint/no-wrapper-object-types': 'error', // Turn off in cbor projects
|
|
134
|
+
'@typescript-eslint/non-nullable-type-assertion-style': 'off', // Can't config
|
|
135
|
+
'@typescript-eslint/only-throw-error': 'error',
|
|
136
|
+
'@typescript-eslint/parameter-properties': 'error',
|
|
137
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
138
|
+
'@typescript-eslint/prefer-destructuring': 'error',
|
|
139
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
140
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
141
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
142
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
143
|
+
'@typescript-eslint/prefer-includes': 'off', // Can't config
|
|
144
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
145
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
146
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off', // Can't config
|
|
147
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
148
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'error',
|
|
149
|
+
'@typescript-eslint/prefer-readonly': 'off', // Can't config
|
|
150
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off', // Can't config
|
|
151
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'off', // Can't config
|
|
152
|
+
'@typescript-eslint/prefer-regexp-exec': 'off', // Can't config
|
|
153
|
+
'@typescript-eslint/prefer-return-this-type': 'off', // Can't config
|
|
154
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'off', // Can't config
|
|
155
|
+
'@typescript-eslint/promise-function-async': 'off', // Can't config
|
|
156
|
+
'@typescript-eslint/require-array-sort-compare': 'off', // Can't config
|
|
157
|
+
'@typescript-eslint/require-await': 'error',
|
|
158
|
+
'@typescript-eslint/restrict-plus-operands': 'off', // Can't config
|
|
159
|
+
'@typescript-eslint/restrict-template-expressions': 'off', // Can't config
|
|
160
|
+
'@typescript-eslint/return-await': 'error',
|
|
161
|
+
'@typescript-eslint/strict-boolean-expressions': 'off', // Can't config
|
|
162
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'off', // Can't config
|
|
163
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
164
|
+
'@typescript-eslint/typedef': 'error',
|
|
165
|
+
'@typescript-eslint/unbound-method': 'off', // Can't config
|
|
166
|
+
'@typescript-eslint/unified-signatures': 'off', // Too hard
|
|
167
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
170
168
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
},
|
|
169
|
+
// These are the stylistic rules that require TS. All of the
|
|
170
|
+
// others from the JS rules should work as-is.
|
|
171
|
+
// [Stylistc](https://eslint.style/packages/ts#rules)
|
|
172
|
+
'@stylistic/member-delimiter-style': 'error',
|
|
173
|
+
'@stylistic/type-annotation-spacing': 'error',
|
|
174
|
+
'@stylistic/type-generic-spacing': 'error',
|
|
175
|
+
'@stylistic/type-named-tuple-spacing': 'error',
|
|
179
176
|
};
|
package/ts.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import {rules} from './rules/ts.js';
|
|
2
|
+
import tslint from 'typescript-eslint';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
const tslint = require('typescript-eslint');
|
|
5
|
-
|
|
6
|
-
module.exports = [{
|
|
4
|
+
const blob = {
|
|
7
5
|
files: ['**/*.ts'],
|
|
8
6
|
ignores: [
|
|
9
7
|
'coverage/**',
|
|
@@ -12,10 +10,12 @@ module.exports = [{
|
|
|
12
10
|
],
|
|
13
11
|
...tslint.configs.base,
|
|
14
12
|
rules,
|
|
15
|
-
}
|
|
13
|
+
};
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
blob.languageOptions.parserOptions = {
|
|
18
16
|
// It's undefined for now, but just in case.
|
|
19
|
-
...
|
|
17
|
+
...blob.languageOptions.parserOptions,
|
|
20
18
|
project: true,
|
|
21
19
|
};
|
|
20
|
+
|
|
21
|
+
export default [blob];
|
package/eslint.config.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import all from './all.js';
|
|
2
|
-
import ava from 'eslint-plugin-ava';
|
|
3
|
-
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
|
-
import meta from '@cto.af/eslint-plugin-meta';
|
|
5
|
-
import n from 'eslint-plugin-n';
|
|
6
|
-
import {plugin} from 'typescript-eslint';
|
|
7
|
-
import stylistic from '@stylistic/eslint-plugin';
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{
|
|
11
|
-
ignores: [
|
|
12
|
-
'test/**',
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
...all,
|
|
16
|
-
{
|
|
17
|
-
files: [
|
|
18
|
-
'rules/*.js',
|
|
19
|
-
],
|
|
20
|
-
settings: {
|
|
21
|
-
meta: {
|
|
22
|
-
libs: {
|
|
23
|
-
ava,
|
|
24
|
-
jsdoc,
|
|
25
|
-
n,
|
|
26
|
-
'@stylistic': stylistic,
|
|
27
|
-
'@typescript-eslint': plugin,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
...meta.configs.all,
|
|
32
|
-
},
|
|
33
|
-
];
|