@cto.af/eslint-config 3.1.0 → 4.0.1

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/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,309 +1,21 @@
1
1
  'use strict';
2
2
 
3
- // Last updated 2024-01-23
4
- // "eslint": "8.56.0"
5
- // "@stylistic/eslint-plugin": "1.5.4",
6
- // "@typescript-eslint/eslint-plugin": "6.19.1"
3
+ const {rules} = require('./rules/ts.js');
4
+ const tslint = require('typescript-eslint');
7
5
 
8
- module.exports = {
9
- parser: '@typescript-eslint/parser',
10
- parserOptions: {
11
- sourceType: 'module',
12
- },
13
- plugins: ['@typescript-eslint', '@stylistic'],
14
- rules: {
15
- // From plugin:@typescript-eslint/eslint-recommended
16
- 'constructor-super': 'off',
17
- 'getter-return': 'off',
18
- 'no-const-assign': 'off',
19
- 'no-dupe-args': 'off',
20
- 'no-dupe-class-members': 'off',
21
- 'no-dupe-keys': 'off',
22
- 'no-func-assign': 'off',
23
- 'no-import-assign': 'off',
24
- 'no-new-symbol': 'off',
25
- 'no-obj-calls': 'off',
26
- 'no-redeclare': 'off',
27
- 'no-setter-return': 'off',
28
- 'no-this-before-super': 'off',
29
- 'no-undef': 'off',
30
- 'no-unreachable': 'off',
31
- 'no-unsafe-negation': 'off',
32
- 'no-var': 'error',
33
- 'prefer-const': 'error',
34
- 'prefer-rest-params': 'error',
35
- 'prefer-spread': 'error',
36
- 'valid-typeof': 'off',
6
+ module.exports = [{
7
+ files: ['**/*.ts'],
8
+ ignores: [
9
+ 'coverage/**',
10
+ 'node_modules/**',
11
+ 'docs/**',
12
+ ],
13
+ ...tslint.configs.base,
14
+ rules,
15
+ }];
37
16
 
38
- // For all of these that have a non-plugin "off" to go with them,
39
- // the typescript-eslint plugin provides a superset of the original
40
- // rule.
41
- '@typescript-eslint/adjacent-overload-signatures': 'error',
42
- '@typescript-eslint/array-type': 'error',
43
- '@typescript-eslint/await-thenable': 'off', // Can't config
44
- '@typescript-eslint/ban-ts-comment': ['error', {
45
- 'ts-expect-error': 'allow-with-description',
46
- }],
47
- '@typescript-eslint/ban-tslint-comment': 'error',
48
- '@typescript-eslint/ban-types': 'off', // Not needed
49
- '@typescript-eslint/class-literal-property-style': ['error', 'getters'],
50
- 'class-methods-use-this': 'off',
51
- '@typescript-eslint/class-methods-use-this': 'error',
52
- 'default-param-last': 'off',
53
- '@typescript-eslint/consistent-generic-constructors': [
54
- 'error',
55
- 'constructor',
56
- ],
57
- '@typescript-eslint/consistent-indexed-object-style': [
58
- 'error',
59
- 'index-signature',
60
- ],
61
- '@typescript-eslint/consistent-type-assertions': [
62
- 'error',
63
- {assertionStyle: 'as', objectLiteralTypeAssertions: 'allow'},
64
- ],
65
- '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
66
- '@typescript-eslint/consistent-type-exports': 'off', // Can't config
67
- '@typescript-eslint/consistent-type-imports': 'off', // Can't do mixed
68
- '@typescript-eslint/default-param-last': 'error',
69
- '@typescript-eslint/dot-notation': 'off', // Can't config
70
- '@typescript-eslint/explicit-function-return-type': 'error',
71
- '@typescript-eslint/explicit-member-accessibility': 'error',
72
- '@typescript-eslint/explicit-module-boundary-types': 'error',
73
- '@typescript-eslint/init-declarations': 'error',
74
- 'max-params': 'off',
75
- '@typescript-eslint/max-params': ['error', {max: 4}],
76
- '@typescript-eslint/member-ordering': 'error',
77
- '@typescript-eslint/method-signature-style': ['error', 'method'],
78
- '@typescript-eslint/naming-convention': 'off', // Too late
79
- 'no-array-constructor': 'off',
80
- '@typescript-eslint/no-array-constructor': 'error',
81
- '@typescript-eslint/no-array-delete': 'error',
82
- '@typescript-eslint/no-base-to-string': 'off', // Can't config
83
- '@typescript-eslint/no-confusing-non-null-assertion': 'error',
84
- '@typescript-eslint/no-confusing-void-expression': 'off', // Can't config
85
- '@typescript-eslint/no-dupe-class-members': 'error',
86
- '@typescript-eslint/no-duplicate-enum-values': 'error',
87
- '@typescript-eslint/no-duplicate-type-constituents': 'error',
88
- '@typescript-eslint/no-dynamic-delete': 'error',
89
- 'no-empty-function': 'off',
90
- '@typescript-eslint/no-empty-function': 'error',
91
- '@typescript-eslint/no-empty-interface': 'error',
92
- '@typescript-eslint/no-explicit-any': 'off', // Too hard
93
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
94
- '@typescript-eslint/no-extraneous-class': 'error',
95
- '@typescript-eslint/no-floating-promises': 'off', // Can't config
96
- '@typescript-eslint/no-for-in-array': 'error',
97
- '@typescript-eslint/no-implied-eval': 'off', // Can't config
98
- '@typescript-eslint/no-import-type-side-effects': 'error',
99
- '@typescript-eslint/no-inferrable-types': 'error',
100
- '@typescript-eslint/no-invalid-this': 'error',
101
- '@typescript-eslint/no-invalid-void-type': 'error',
102
- 'no-loop-func': 'off',
103
- '@typescript-eslint/no-loop-func': 'error',
104
- '@typescript-eslint/no-loss-of-precision': 'error',
105
- '@typescript-eslint/no-magic-numbers': 'off', // Too late
106
- '@typescript-eslint/no-meaningless-void-operator': 'off', // Can't config
107
- '@typescript-eslint/no-misused-new': 'error',
108
- '@typescript-eslint/no-misused-promises': 'off', // Can't config
109
- '@typescript-eslint/no-mixed-enums': 'error',
110
- '@typescript-eslint/no-namespace': 'error',
111
- '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
112
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
113
- '@typescript-eslint/no-non-null-assertion': 'error',
114
- '@typescript-eslint/no-redeclare': 'error',
115
- '@typescript-eslint/no-redundant-type-constituents': 'off', // Can't config
116
- '@typescript-eslint/no-require-imports': 'error',
117
- '@typescript-eslint/no-restricted-imports': 'off', // Not needed
118
- '@typescript-eslint/no-shadow': 'error',
119
- '@typescript-eslint/no-this-alias': 'error',
120
- '@typescript-eslint/no-throw-literal': 'off', // Can't config
121
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // Can't config
122
- '@typescript-eslint/no-unnecessary-condition': 'off', // Can't config
123
- '@typescript-eslint/no-unnecessary-qualifier': 'off', // Can't config
124
- '@typescript-eslint/no-unnecessary-type-arguments': 'off', // Can't config
125
- '@typescript-eslint/no-unnecessary-type-assertion': 'off', // Can't config
126
- '@typescript-eslint/no-unnecessary-type-constraint': 'error',
127
- '@typescript-eslint/no-unsafe-argument': 'off', // Can't config
128
- '@typescript-eslint/no-unsafe-assignment': 'off', // Can't config
129
- '@typescript-eslint/no-unsafe-call': 'off', // Can't config
130
- '@typescript-eslint/no-unsafe-declaration-merging': 'error',
131
- '@typescript-eslint/no-unsafe-enum-comparison': 'error',
132
- '@typescript-eslint/no-unsafe-member-access': 'off', // Can't config
133
- '@typescript-eslint/no-unsafe-return': 'off', // Can't config
134
- '@typescript-eslint/no-unsafe-unary-minus': 'error',
135
- '@typescript-eslint/no-unused-expressions': 'error',
136
- 'no-unused-vars': 'off',
137
- '@typescript-eslint/no-unused-vars': [
138
- 'error', {
139
- args: 'none',
140
- argsIgnorePattern: '^_',
141
- caughtErrors: 'all',
142
- caughtErrorsIgnorePattern: '^(_|ignore)',
143
- varsIgnorePattern: '^_',
144
- },
145
- ],
146
- '@typescript-eslint/no-use-before-define': 'error',
147
- '@typescript-eslint/no-useless-constructor': 'error',
148
- '@typescript-eslint/no-useless-empty-export': 'error',
149
- '@typescript-eslint/no-useless-template-literals': 'error',
150
- '@typescript-eslint/no-var-requires': 'error',
151
- '@typescript-eslint/non-nullable-type-assertion-style': 'off', // Can't config
152
- '@typescript-eslint/parameter-properties': 'error',
153
- '@typescript-eslint/prefer-as-const': 'error',
154
- 'prefer-destructuring': 'off',
155
- '@typescript-eslint/prefer-destructuring': 'error',
156
- '@typescript-eslint/prefer-enum-initializers': 'error',
157
- '@typescript-eslint/prefer-for-of': 'error',
158
- '@typescript-eslint/prefer-function-type': 'error',
159
- '@typescript-eslint/prefer-includes': 'off', // Can't config
160
- '@typescript-eslint/prefer-literal-enum-member': 'error',
161
- '@typescript-eslint/prefer-namespace-keyword': 'error',
162
- '@typescript-eslint/prefer-nullish-coalescing': 'off', // Can't config
163
- '@typescript-eslint/prefer-optional-chain': 'error',
164
- '@typescript-eslint/prefer-promise-reject-errors': 'error',
165
- '@typescript-eslint/prefer-readonly-parameter-types': 'off', // Can't config
166
- '@typescript-eslint/prefer-readonly': 'off', // Can't config
167
- '@typescript-eslint/prefer-reduce-type-parameter': 'off', // Can't config
168
- '@typescript-eslint/prefer-regexp-exec': 'off', // Can't config
169
- '@typescript-eslint/prefer-return-this-type': 'off', // Can't config
170
- '@typescript-eslint/prefer-string-starts-ends-with': 'off', // Can't config
171
- '@typescript-eslint/prefer-ts-expect-error': 'error',
172
- '@typescript-eslint/promise-function-async': 'off', // Can't config
173
- '@typescript-eslint/require-array-sort-compare': 'off', // Can't config
174
- '@typescript-eslint/require-await': 'off', // Can't config
175
- '@typescript-eslint/restrict-plus-operands': 'off', // Can't config
176
- '@typescript-eslint/restrict-template-expressions': 'off', // Can't config
177
- '@typescript-eslint/return-await': 'off', // Can't config
178
- '@typescript-eslint/sort-type-constituents': 'error',
179
- '@typescript-eslint/strict-boolean-expressions': 'off', // Can't config
180
- '@typescript-eslint/switch-exhaustiveness-check': 'off', // Can't config
181
- '@typescript-eslint/triple-slash-reference': 'error',
182
- '@typescript-eslint/typedef': 'error',
183
- '@typescript-eslint/unbound-method': 'off', // Can't config
184
- '@typescript-eslint/unified-signatures': 'off', // Too hard
185
-
186
- // [Stylistc](https://eslint.style/packages/default)
187
- '@stylistic/array-bracket-newline': ['error', 'consistent'],
188
- '@stylistic/array-bracket-spacing': ['error', 'never'],
189
- '@stylistic/array-element-newline': ['error', 'consistent'],
190
- '@stylistic/arrow-parens': ['error', 'as-needed'],
191
- '@stylistic/arrow-spacing': 'error',
192
- '@stylistic/block-spacing': ['error', 'always'],
193
- '@stylistic/brace-style': ['error', '1tbs', {
194
- allowSingleLine: true,
195
- }],
196
- '@stylistic/comma-dangle': [
197
- 'error',
198
- {
199
- arrays: 'always-multiline',
200
- objects: 'always-multiline',
201
- imports: 'always-multiline',
202
- exports: 'always-multiline',
203
- functions: 'never',
204
- enums: 'always-multiline',
205
- generics: 'never',
206
- tuples: 'always-multiline',
207
- },
208
- ],
209
- '@stylistic/comma-spacing': 'error',
210
- '@stylistic/comma-style': ['error', 'last'],
211
- '@stylistic/computed-property-spacing': 'error',
212
- '@stylistic/dot-location': ['error', 'property'],
213
- '@stylistic/eol-last': 'error',
214
- '@stylistic/func-call-spacing': 'off', // Renamed
215
- '@stylistic/function-call-argument-newline': ['error', 'consistent'],
216
- '@stylistic/function-call-spacing': 'error',
217
- '@stylistic/function-paren-newline': ['error', 'consistent'],
218
- '@stylistic/generator-star-spacing': 'error',
219
- '@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
220
- '@stylistic/indent': ['error', 2], // Still broken?
221
- '@stylistic/indent-binary-ops': 'off', // Not good enough
222
-
223
- '@stylistic/jsx-child-element-spacing': 'off', // Not needed
224
- '@stylistic/jsx-closing-bracket-location': 'off', // Not needed
225
- '@stylistic/jsx-closing-tag-location': 'off', // Not needed
226
- '@stylistic/jsx-curly-brace-presence': 'off', // Not needed
227
- '@stylistic/jsx-curly-newline': 'off', // Not needed
228
- '@stylistic/jsx-curly-spacing': 'off', // Not needed
229
- '@stylistic/jsx-equals-spacing': 'off', // Not needed
230
- '@stylistic/jsx-first-prop-new-line': 'off', // Not needed
231
- '@stylistic/jsx-indent': 'off', // Not needed
232
- '@stylistic/jsx-indent-props': 'off', // Not needed
233
- '@stylistic/jsx-max-props-per-line': 'off', // Not needed
234
- '@stylistic/jsx-newline': 'off', // Not needed
235
- '@stylistic/jsx-one-expression-per-line': 'off', // Not needed
236
- '@stylistic/jsx-props-no-multi-spaces': 'off', // Not needed
237
- '@stylistic/jsx-quotes': 'off', // Not needed
238
- '@stylistic/jsx-self-closing-comp': 'off', // Not needed
239
- '@stylistic/jsx-sort-props': 'off', // Not needed
240
- '@stylistic/jsx-tag-spacing': 'off', // Not needed
241
- '@stylistic/jsx-wrap-multilines': 'off', // Not needed
242
-
243
- '@stylistic/key-spacing': ['error', {mode: 'minimum'}],
244
- '@stylistic/keyword-spacing': 'error',
245
- '@stylistic/linebreak-style': 'error',
246
- '@stylistic/lines-around-comment': ['error', {
247
- allowBlockStart: true,
248
- allowClassStart: true,
249
- allowEnumStart: true,
250
- allowInterfaceStart: true,
251
- allowModuleStart: true,
252
- allowTypeStart: true,
253
- }],
254
- '@stylistic/lines-between-class-members': ['error', 'always', {
255
- exceptAfterSingleLine: true,
256
- }],
257
- '@stylistic/max-len': ['error', 80, {
258
- ignoreRegExpLiterals: true,
259
- ignoreStrings: true,
260
- ignoreTemplateLiterals: true,
261
- ignoreUrls: true,
262
- }],
263
- '@stylistic/max-statements-per-line': 'off',
264
- '@stylistic/member-delimiter-style': 'error',
265
- '@stylistic/multiline-ternary': ['error', 'always-multiline'],
266
- '@stylistic/new-parens': 'error',
267
- '@stylistic/newline-per-chained-call': 'error',
268
- '@stylistic/no-confusing-arrow': 'error',
269
- '@stylistic/no-extra-parens': 'off', // Disagree
270
- '@stylistic/no-extra-semi': 'error',
271
- '@stylistic/no-floating-decimal': 'error',
272
- '@stylistic/no-mixed-operators': 'error',
273
- '@stylistic/no-mixed-spaces-and-tabs': 'error',
274
- '@stylistic/no-multi-spaces': 'error',
275
- '@stylistic/no-multiple-empty-lines': ['error', {max: 1}],
276
- '@stylistic/no-tabs': 'error',
277
- '@stylistic/no-trailing-spaces': 'error',
278
- '@stylistic/no-whitespace-before-property': 'error',
279
- '@stylistic/nonblock-statement-body-position': 'error',
280
- '@stylistic/object-curly-newline': 'error',
281
- '@stylistic/object-curly-spacing': ['error', 'never'],
282
- '@stylistic/object-property-newline': ['error', {allowAllPropertiesOnSameLine: true}],
283
- '@stylistic/one-var-declaration-per-line': 'error',
284
- '@stylistic/operator-linebreak': ['error', 'after'],
285
- '@stylistic/padded-blocks': ['error', 'never'],
286
- '@stylistic/padding-line-between-statements': 'error',
287
- '@stylistic/quote-props': ['error', 'consistent-as-needed'],
288
- '@stylistic/quotes': ['error', 'single', {avoidEscape: true}],
289
- '@stylistic/rest-spread-spacing': ['error', 'never'],
290
- '@stylistic/semi': ['error', 'always'],
291
- '@stylistic/semi-spacing': 'error',
292
- '@stylistic/semi-style': ['error'],
293
- '@stylistic/space-before-blocks': 'error',
294
- '@stylistic/space-before-function-paren': ['error', 'never'],
295
- '@stylistic/space-in-parens': 'error',
296
- '@stylistic/space-infix-ops': ['error', {int32Hint: false}],
297
- '@stylistic/space-unary-ops': 'error',
298
- '@stylistic/spaced-comment': ['error', 'always'],
299
- '@stylistic/switch-colon-spacing': 'error',
300
- '@stylistic/template-curly-spacing': 'error',
301
- '@stylistic/template-tag-spacing': 'error',
302
- '@stylistic/type-annotation-spacing': 'error',
303
- '@stylistic/type-generic-spacing': 'error',
304
- '@stylistic/type-named-tuple-spacing': 'error',
305
- '@stylistic/wrap-iife': 'error',
306
- '@stylistic/wrap-regex': 'off', // No.
307
- '@stylistic/yield-star-spacing': ['error', 'before'],
308
- },
17
+ module.exports[0].languageOptions.parserOptions = {
18
+ // It's undefined for now, but just in case.
19
+ ...module.exports[0].languageOptions.parserOptions,
20
+ project: true,
309
21
  };
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
- };