eslint-config-airbnb-extended 0.11.0 → 0.11.2
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.
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const importsStrictRules = {
|
|
4
4
|
name: 'airbnb/config/import-x/strict',
|
|
5
5
|
rules: {
|
|
6
|
+
// enforce a consistent style for type specifiers (inline or top-level)
|
|
7
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
|
|
8
|
+
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
6
9
|
// Reports if a module's default export is unnamed
|
|
7
10
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
|
|
8
11
|
'import-x/no-anonymous-default-export': [
|
|
@@ -18,27 +18,36 @@ const typescriptEslintRules = {
|
|
|
18
18
|
rules: {
|
|
19
19
|
// Require that function overload signatures be consecutive.
|
|
20
20
|
// https://typescript-eslint.io/rules/adjacent-overload-signatures
|
|
21
|
+
// Recommended in stylistic by the TypeScript Eslint team
|
|
21
22
|
'@typescript-eslint/adjacent-overload-signatures': 'off',
|
|
22
23
|
// Require consistently using either T[] or Array<T> for arrays.
|
|
23
24
|
// https://typescript-eslint.io/rules/array-type
|
|
24
|
-
'@typescript-eslint/array-type':
|
|
25
|
+
'@typescript-eslint/array-type': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
default: 'array',
|
|
29
|
+
readonly: 'array',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
25
32
|
// Disallow awaiting a value that is not a Thenable.
|
|
26
33
|
// https://typescript-eslint.io/rules/await-thenable
|
|
27
34
|
'@typescript-eslint/await-thenable': 'off',
|
|
28
35
|
// Disallow @ts-<directive> comments or require descriptions after directives.
|
|
29
36
|
// https://typescript-eslint.io/rules/ban-ts-comment
|
|
37
|
+
// Recommended by the TypeScript Eslint team
|
|
30
38
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
31
39
|
// Disallow // tslint:<rule-flag> comments.
|
|
32
40
|
// https://typescript-eslint.io/rules/ban-tslint-comment
|
|
33
41
|
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
34
42
|
// Enforce that literals on classes are exposed in a consistent style.
|
|
35
43
|
// https://typescript-eslint.io/rules/class-literal-property-style
|
|
36
|
-
'@typescript-eslint/class-literal-property-style': '
|
|
44
|
+
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
|
|
37
45
|
// Enforce that class methods utilize this.
|
|
38
46
|
// https://typescript-eslint.io/rules/class-methods-use-this
|
|
39
47
|
'@typescript-eslint/class-methods-use-this': 'off',
|
|
40
48
|
// Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.
|
|
41
49
|
// https://typescript-eslint.io/rules/consistent-generic-constructors
|
|
50
|
+
// Recommended in stylistic by the TypeScript Eslint team
|
|
42
51
|
'@typescript-eslint/consistent-generic-constructors': 'off',
|
|
43
52
|
// Require or disallow the Record type.
|
|
44
53
|
// https://typescript-eslint.io/rules/consistent-indexed-object-style
|
|
@@ -49,6 +58,7 @@ const typescriptEslintRules = {
|
|
|
49
58
|
'@typescript-eslint/consistent-return': 'off',
|
|
50
59
|
// Enforce consistent usage of type assertions.
|
|
51
60
|
// https://typescript-eslint.io/rules/consistent-type-assertions
|
|
61
|
+
// Recommended in stylistic by the TypeScript Eslint team
|
|
52
62
|
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
53
63
|
// Enforce type definitions to consistently use either interface or type.
|
|
54
64
|
// https://typescript-eslint.io/rules/consistent-type-definitions
|
|
@@ -122,7 +132,7 @@ const typescriptEslintRules = {
|
|
|
122
132
|
'@typescript-eslint/no-base-to-string': 'off',
|
|
123
133
|
// Disallow non-null assertion in locations that may be confusing.
|
|
124
134
|
// https://typescript-eslint.io/rules/no-confusing-non-null-assertion
|
|
125
|
-
'@typescript-eslint/no-confusing-non-null-assertion': '
|
|
135
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
126
136
|
// Require expressions of type void to appear in statement position.
|
|
127
137
|
// https://typescript-eslint.io/rules/no-confusing-void-expression
|
|
128
138
|
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
@@ -148,9 +158,16 @@ const typescriptEslintRules = {
|
|
|
148
158
|
'@typescript-eslint/no-empty-function': best_practices_1.default.rules['no-empty-function'],
|
|
149
159
|
// Disallow accidentally using the "empty object" type.
|
|
150
160
|
// https://typescript-eslint.io/rules/no-empty-object-type
|
|
151
|
-
'@typescript-eslint/no-empty-object-type':
|
|
161
|
+
'@typescript-eslint/no-empty-object-type': [
|
|
162
|
+
'error',
|
|
163
|
+
{
|
|
164
|
+
allowInterfaces: 'never',
|
|
165
|
+
allowObjectTypes: 'never',
|
|
166
|
+
},
|
|
167
|
+
],
|
|
152
168
|
// Disallow the any type.
|
|
153
169
|
// https://typescript-eslint.io/rules/no-explicit-any
|
|
170
|
+
// Recommended by the TypeScript Eslint team
|
|
154
171
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
155
172
|
// Disallow extra non-null assertions.
|
|
156
173
|
// https://typescript-eslint.io/rules/no-extra-non-null-assertion
|
|
@@ -223,6 +240,7 @@ const typescriptEslintRules = {
|
|
|
223
240
|
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'off',
|
|
224
241
|
// Disallow non-null assertions after an optional chain expression.
|
|
225
242
|
// https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
|
|
243
|
+
// Recommended by the TypeScript Eslint team
|
|
226
244
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
|
227
245
|
// Disallow non-null assertions using the ! postfix operator.
|
|
228
246
|
// https://typescript-eslint.io/rules/no-non-null-assertion
|
|
@@ -365,6 +383,7 @@ const typescriptEslintRules = {
|
|
|
365
383
|
'@typescript-eslint/prefer-find': 'error',
|
|
366
384
|
// Enforce the use of for-of loop over the standard for loop where possible.
|
|
367
385
|
// https://typescript-eslint.io/rules/prefer-for-of
|
|
386
|
+
// Recommended in stylistic by the TypeScript Eslint team
|
|
368
387
|
'@typescript-eslint/prefer-for-of': 'off',
|
|
369
388
|
// Enforce using function types instead of interfaces with call signatures.
|
|
370
389
|
// https://typescript-eslint.io/rules/prefer-function-type
|
|
@@ -8,15 +8,6 @@ const typescriptEslintStrictRules = {
|
|
|
8
8
|
// Require that function overload signatures be consecutive.
|
|
9
9
|
// https://typescript-eslint.io/rules/adjacent-overload-signatures
|
|
10
10
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
11
|
-
// Require consistently using either T[] or Array<T> for arrays.
|
|
12
|
-
// https://typescript-eslint.io/rules/array-type
|
|
13
|
-
'@typescript-eslint/array-type': [
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
default: 'array',
|
|
17
|
-
readonly: 'array',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
11
|
// Disallow awaiting a value that is not a Thenable.
|
|
21
12
|
// https://typescript-eslint.io/rules/await-thenable
|
|
22
13
|
'@typescript-eslint/await-thenable': 'error',
|
|
@@ -32,12 +23,9 @@ const typescriptEslintStrictRules = {
|
|
|
32
23
|
'ts-nocheck': true,
|
|
33
24
|
},
|
|
34
25
|
],
|
|
35
|
-
// Enforce that literals on classes are exposed in a consistent style.
|
|
36
|
-
// https://typescript-eslint.io/rules/class-literal-property-style
|
|
37
|
-
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
|
|
38
26
|
// Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.
|
|
39
27
|
// https://typescript-eslint.io/rules/consistent-generic-constructors
|
|
40
|
-
'@typescript-eslint/consistent-generic-constructors': ['error', '
|
|
28
|
+
'@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
|
|
41
29
|
// Enforce consistent usage of type assertions.
|
|
42
30
|
// https://typescript-eslint.io/rules/consistent-type-assertions
|
|
43
31
|
'@typescript-eslint/consistent-type-assertions': [
|
|
@@ -85,9 +73,6 @@ const typescriptEslintStrictRules = {
|
|
|
85
73
|
// Disallow using the delete operator on array values.
|
|
86
74
|
// https://typescript-eslint.io/rules/no-array-delete
|
|
87
75
|
'@typescript-eslint/no-array-delete': 'error',
|
|
88
|
-
// Disallow non-null assertion in locations that may be confusing.
|
|
89
|
-
// https://typescript-eslint.io/rules/no-confusing-non-null-assertion
|
|
90
|
-
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
91
76
|
// Require expressions of type void to appear in statement position.
|
|
92
77
|
// https://typescript-eslint.io/rules/no-confusing-void-expression
|
|
93
78
|
'@typescript-eslint/no-confusing-void-expression': [
|
|
@@ -107,15 +92,6 @@ const typescriptEslintStrictRules = {
|
|
|
107
92
|
ignoreUnions: false,
|
|
108
93
|
},
|
|
109
94
|
],
|
|
110
|
-
// Disallow accidentally using the "empty object" type.
|
|
111
|
-
// https://typescript-eslint.io/rules/no-empty-object-type
|
|
112
|
-
'@typescript-eslint/no-empty-object-type': [
|
|
113
|
-
'error',
|
|
114
|
-
{
|
|
115
|
-
allowInterfaces: 'never',
|
|
116
|
-
allowObjectTypes: 'never',
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
95
|
// Disallow the any type.
|
|
120
96
|
// https://typescript-eslint.io/rules/no-explicit-any
|
|
121
97
|
'@typescript-eslint/no-explicit-any': [
|
|
@@ -137,14 +113,6 @@ const typescriptEslintStrictRules = {
|
|
|
137
113
|
allowInGenericTypeArguments: true,
|
|
138
114
|
},
|
|
139
115
|
],
|
|
140
|
-
// Disallow the void operator except when used to discard a value.
|
|
141
|
-
// https://typescript-eslint.io/rules/no-meaningless-void-operator
|
|
142
|
-
'@typescript-eslint/no-meaningless-void-operator': [
|
|
143
|
-
'error',
|
|
144
|
-
{
|
|
145
|
-
checkNever: false,
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
116
|
// Disallow Promises in places not designed to handle them.
|
|
149
117
|
// https://typescript-eslint.io/rules/no-misused-promises
|
|
150
118
|
'@typescript-eslint/no-misused-promises': [
|
|
@@ -178,9 +146,6 @@ const typescriptEslintStrictRules = {
|
|
|
178
146
|
// Disallow unnecessary equality comparisons against boolean literals.
|
|
179
147
|
// https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
|
|
180
148
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
181
|
-
// Disallow assigning a value with type any to variables and properties.
|
|
182
|
-
// https://typescript-eslint.io/rules/no-unsafe-assignment
|
|
183
|
-
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
184
149
|
// Disallow calling a value with type any.
|
|
185
150
|
// https://typescript-eslint.io/rules/no-unsafe-call
|
|
186
151
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
@@ -192,7 +157,7 @@ const typescriptEslintStrictRules = {
|
|
|
192
157
|
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
193
158
|
// Enforce the use of for-of loop over the standard for loop where possible.
|
|
194
159
|
// https://typescript-eslint.io/rules/prefer-for-of
|
|
195
|
-
'@typescript-eslint/prefer-for-of': '
|
|
160
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
196
161
|
// Enforce includes method over indexOf method.
|
|
197
162
|
// https://typescript-eslint.io/rules/prefer-includes
|
|
198
163
|
'@typescript-eslint/prefer-includes': 'warn',
|
package/dist/utils/index.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.jsExtensionsRule = Object.fromEntries(Object.values(exports.jsExtensions
|
|
|
8
8
|
exports.tsExtensions = ['.ts', '.cts', '.mts'];
|
|
9
9
|
exports.tsExtensionsWithReact = [...exports.tsExtensions, '.tsx'];
|
|
10
10
|
exports.tsExtensionsWithReactDTS = [...exports.tsExtensionsWithReact, '.d.ts'];
|
|
11
|
-
exports.tsExtensionsResolver = [exports.tsExtensions, '.d.ts'];
|
|
11
|
+
exports.tsExtensionsResolver = [...exports.tsExtensions, '.d.ts'];
|
|
12
12
|
exports.tsExtensionsRule = Object.fromEntries(Object.values(exports.tsExtensionsWithReact).map((val) => [val.slice(1), 'never']));
|
|
13
13
|
// ESLINT CONFIG FILES
|
|
14
|
-
exports.tsFiles = exports.tsExtensionsWithReact.map((val) =>
|
|
14
|
+
exports.tsFiles = exports.tsExtensionsWithReact.map((val) => `**/*${val}`);
|