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