eslint-config-airbnb-extended 0.10.2 → 0.11.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/README.md CHANGED
@@ -37,6 +37,7 @@ The configuration may change over time, and `create-airbnb-x-config` will always
37
37
 
38
38
  This configuration relies on the following essential packages:
39
39
 
40
+ - **`@stylistic/eslint-plugin`**: Ensures fine-tuned styling rules for code formatting.
40
41
  - **`eslint-import-x`**: A powerful tool for managing and validating imports.
41
42
  - **`eslint-plugin-n`**: Enforces best practices for Node.js.
42
43
  - **`eslint-plugin-react`**: Enforces React-specific linting rules and best practices.
@@ -6,7 +6,7 @@ export declare const rules: {
6
6
  readonly node: Record<"globals" | "base" | "promises" | "noUnsupportedFeatures", import("eslint").Linter.Config>;
7
7
  readonly react: Record<"strict" | "stylistic" | "base" | "jsxA11y" | "hooks", import("eslint").Linter.Config>;
8
8
  readonly next: Record<"base" | "coreWebVitals", import("eslint").Linter.Config>;
9
- readonly typescript: Record<"imports" | "stylistic" | "stylisticPlus" | "base" | "typescriptEslint", import("eslint").Linter.Config>;
9
+ readonly typescript: Record<"imports" | "stylistic" | "stylisticPlus" | "base" | "typescriptEslint" | "typescriptEslintStrict", import("eslint").Linter.Config>;
10
10
  };
11
11
  export declare const configs: {
12
12
  readonly base: Record<"all" | "typescript" | "recommended", import("eslint").Linter.Config[]>;
@@ -15,6 +15,7 @@ export declare const configs: {
15
15
  readonly node: Record<"recommended", import("eslint").Linter.Config[]>;
16
16
  };
17
17
  export declare const plugins: {
18
+ readonly stylistic: import("eslint").Linter.Config;
18
19
  readonly importX: import("eslint").Linter.Config;
19
20
  readonly node: import("eslint").Linter.Config;
20
21
  readonly react: import("eslint").Linter.Config;
@@ -22,5 +23,4 @@ export declare const plugins: {
22
23
  readonly reactHooks: import("eslint").Linter.Config;
23
24
  readonly next: import("eslint").Linter.Config;
24
25
  readonly typescriptEslint: import("eslint").Linter.Config;
25
- readonly stylistic: import("eslint").Linter.Config;
26
26
  };
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const eslint_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
7
+ const typescript_eslint_1 = require("typescript-eslint");
7
8
  const config_1 = __importDefault(require("../../configs/typescript/config"));
8
9
  const getStylisticLegacyConfig_1 = __importDefault(require("../../helpers/getStylisticLegacyConfig"));
9
10
  const baseTypescriptConfig = [
@@ -20,5 +21,6 @@ const baseTypescriptConfig = [
20
21
  },
21
22
  },
22
23
  Object.assign({ name: 'airbnb/config/base-typescript-disable-legacy-stylistic-ts-config' }, (0, getStylisticLegacyConfig_1.default)('typescript')),
24
+ Object.assign(Object.assign({}, typescript_eslint_1.configs.disableTypeChecked), { name: 'airbnb/config/base-typescript-disable-type-checked', files: ['**/*.{js,cjs,mjs}'] }),
23
25
  ];
24
26
  exports.default = baseTypescriptConfig;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const config_1 = __importDefault(require("../../configs/typescript/config"));
7
+ const typescriptEslintStrict_1 = __importDefault(require("../../rules/typescript/typescriptEslintStrict"));
8
+ const typescriptConfigExtended = Object.assign(Object.assign({}, config_1.default), { typescriptEslintStrict: typescriptEslintStrict_1.default });
9
+ exports.default = typescriptConfigExtended;
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  * as is given due to less size of index.d.ts
6
6
  */
7
7
  const plugins = {
8
+ get stylistic() {
9
+ return require('../plugins/stylisticPlugin').default;
10
+ },
8
11
  get importX() {
9
12
  return require('../plugins/importXPlugin').default;
10
13
  },
@@ -26,8 +29,5 @@ const plugins = {
26
29
  get typescriptEslint() {
27
30
  return require('../plugins/typescriptEslintPlugin').default;
28
31
  },
29
- get stylistic() {
30
- return require('../plugins/stylisticPlugin').default;
31
- },
32
32
  };
33
33
  exports.default = plugins;
@@ -176,15 +176,7 @@ const bestPracticesRules = {
176
176
  'no-loop-func': 'error',
177
177
  // disallow magic numbers
178
178
  // https://eslint.org/docs/rules/no-magic-numbers
179
- 'no-magic-numbers': [
180
- 'off',
181
- {
182
- ignore: [],
183
- ignoreArrayIndexes: true,
184
- enforceConst: true,
185
- detectObjects: false,
186
- },
187
- ],
179
+ 'no-magic-numbers': 'off',
188
180
  // disallow use of multiline strings
189
181
  // https://eslint.org/docs/rules/no-multi-str
190
182
  'no-multi-str': 'error',
package/dist/rules/es6.js CHANGED
@@ -55,13 +55,7 @@ const es6Rules = {
55
55
  ],
56
56
  // disallow specific imports
57
57
  // https://eslint.org/docs/rules/no-restricted-imports
58
- 'no-restricted-imports': [
59
- 'off',
60
- {
61
- paths: [],
62
- patterns: [],
63
- },
64
- ],
58
+ 'no-restricted-imports': 'off',
65
59
  // disallow to use this/super before super() calling in constructors.
66
60
  // https://eslint.org/docs/rules/no-this-before-super
67
61
  'no-this-before-super': 'error',
@@ -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,7 +18,7 @@ const rules = {
18
18
  return require('../configs/next/config').default;
19
19
  },
20
20
  get typescript() {
21
- return require('../configs/typescript/config').default;
21
+ return require('../configs/typescript/configExtended').default;
22
22
  },
23
23
  };
24
24
  exports.default = rules;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.deprecatedTypescriptEslintRules = void 0;
6
7
  const best_practices_1 = __importDefault(require("../../rules/best-practices"));
7
8
  const es6_1 = __importDefault(require("../../rules/es6"));
8
9
  const style_1 = __importDefault(require("../../rules/style"));
@@ -15,97 +16,486 @@ const typescriptEslintRules = {
15
16
  },
16
17
  },
17
18
  rules: {
18
- // Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
19
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
19
+ // Require that function overload signatures be consecutive.
20
+ // https://typescript-eslint.io/rules/adjacent-overload-signatures
21
+ // Recommended in stylistic by the TypeScript Eslint team
22
+ '@typescript-eslint/adjacent-overload-signatures': 'off',
23
+ // Require consistently using either T[] or Array<T> for arrays.
24
+ // https://typescript-eslint.io/rules/array-type
25
+ '@typescript-eslint/array-type': [
26
+ 'error',
27
+ {
28
+ default: 'array',
29
+ readonly: 'array',
30
+ },
31
+ ],
32
+ // Disallow awaiting a value that is not a Thenable.
33
+ // https://typescript-eslint.io/rules/await-thenable
34
+ '@typescript-eslint/await-thenable': 'off',
35
+ // Disallow @ts-<directive> comments or require descriptions after directives.
36
+ // https://typescript-eslint.io/rules/ban-ts-comment
37
+ // Recommended by the TypeScript Eslint team
38
+ '@typescript-eslint/ban-ts-comment': 'off',
39
+ // Disallow // tslint:<rule-flag> comments.
40
+ // https://typescript-eslint.io/rules/ban-tslint-comment
41
+ '@typescript-eslint/ban-tslint-comment': 'error',
42
+ // Enforce that literals on classes are exposed in a consistent style.
43
+ // https://typescript-eslint.io/rules/class-literal-property-style
44
+ '@typescript-eslint/class-literal-property-style': ['error', 'fields'],
45
+ // Enforce that class methods utilize this.
46
+ // https://typescript-eslint.io/rules/class-methods-use-this
47
+ '@typescript-eslint/class-methods-use-this': 'off',
48
+ // Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.
49
+ // https://typescript-eslint.io/rules/consistent-generic-constructors
50
+ // Recommended in stylistic by the TypeScript Eslint team
51
+ '@typescript-eslint/consistent-generic-constructors': 'off',
52
+ // Require or disallow the Record type.
53
+ // https://typescript-eslint.io/rules/consistent-indexed-object-style
54
+ '@typescript-eslint/consistent-indexed-object-style': 'error',
55
+ // Require return statements to either always or never specify values.
56
+ // https://typescript-eslint.io/rules/consistent-return
57
+ // Not recommended by the TypeScript Eslint team due to "noImplicitReturns" TypeScript rule
58
+ '@typescript-eslint/consistent-return': 'off',
59
+ // Enforce consistent usage of type assertions.
60
+ // https://typescript-eslint.io/rules/consistent-type-assertions
61
+ // Recommended in stylistic by the TypeScript Eslint team
62
+ '@typescript-eslint/consistent-type-assertions': 'off',
63
+ // Enforce type definitions to consistently use either interface or type.
64
+ // https://typescript-eslint.io/rules/consistent-type-definitions
65
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
66
+ // Enforce consistent usage of type exports.
67
+ // https://typescript-eslint.io/rules/consistent-type-exports
68
+ '@typescript-eslint/consistent-type-exports': 'off',
69
+ // Enforce consistent usage of type imports.
70
+ // https://typescript-eslint.io/rules/consistent-type-imports
71
+ '@typescript-eslint/consistent-type-imports': 'off',
72
+ // Enforce default parameters to be last.
73
+ // https://typescript-eslint.io/rules/default-param-last
74
+ 'default-param-last': 'off',
75
+ '@typescript-eslint/default-param-last': best_practices_1.default.rules['default-param-last'],
76
+ // Enforce dot notation whenever possible.
77
+ // https://typescript-eslint.io/rules/dot-notation
78
+ 'dot-notation': 'off',
79
+ '@typescript-eslint/dot-notation': [
80
+ best_practices_1.default.rules['dot-notation'][0],
81
+ Object.assign(Object.assign({}, best_practices_1.default.rules['dot-notation'][1]), { allowPrivateClassPropertyAccess: false, allowProtectedClassPropertyAccess: false, allowIndexSignaturePropertyAccess: false }),
82
+ ],
83
+ // Require explicit return types on functions and class methods.
84
+ // https://typescript-eslint.io/rules/explicit-function-return-type
85
+ '@typescript-eslint/explicit-function-return-type': 'off',
86
+ // Require explicit accessibility modifiers on class properties and methods.
87
+ // https://typescript-eslint.io/rules/explicit-member-accessibility
88
+ '@typescript-eslint/explicit-member-accessibility': 'off',
89
+ // Require explicit return and argument types on exported functions' and classes' public class methods.
90
+ // https://typescript-eslint.io/rules/explicit-module-boundary-types
91
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
92
+ // Require or disallow initialization in variable declarations.
93
+ // https://typescript-eslint.io/rules/init-declarations
94
+ '@typescript-eslint/init-declarations': 'off',
95
+ // Enforce a maximum number of parameters in function definitions.
96
+ // https://typescript-eslint.io/rules/max-params
97
+ '@typescript-eslint/max-params': 'off',
98
+ // Require a consistent member declaration order.
99
+ // https://typescript-eslint.io/rules/member-ordering
100
+ // Not recommended by the TypeScript Eslint team due to "eslint-plugin-perfectionist"
101
+ '@typescript-eslint/member-ordering': 'off',
102
+ // Enforce using a particular method signature syntax.
103
+ // https://typescript-eslint.io/rules/method-signature-style
104
+ '@typescript-eslint/method-signature-style': 'off',
105
+ // Enforce naming conventions for everything across a codebase.
106
+ // https://typescript-eslint.io/rules/naming-convention
20
107
  camelcase: 'off',
21
- // The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
22
108
  '@typescript-eslint/naming-convention': [
23
109
  'error',
24
- // Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10)
25
110
  {
26
111
  selector: 'variable',
27
112
  format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
28
113
  },
29
- // Allow camelCase functions (23.2), and PascalCase functions (23.8)
30
114
  {
31
115
  selector: 'function',
32
116
  format: ['camelCase', 'PascalCase'],
33
117
  },
34
- // Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make TypeScript recommendations, we are assuming this rule would similarly apply to anything "type like", including interfaces, type aliases, and enums
35
118
  {
36
119
  selector: 'typeLike',
37
120
  format: ['PascalCase'],
38
121
  },
39
122
  ],
40
- // Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
41
- // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
42
- 'default-param-last': 'off',
43
- '@typescript-eslint/default-param-last': best_practices_1.default.rules['default-param-last'],
44
- // Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
45
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
46
- 'dot-notation': 'off',
47
- '@typescript-eslint/dot-notation': best_practices_1.default.rules['dot-notation'],
48
- // Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
49
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
123
+ // Disallow generic Array constructors.
124
+ // https://typescript-eslint.io/rules/no-array-constructor
50
125
  'no-array-constructor': 'off',
51
126
  '@typescript-eslint/no-array-constructor': style_1.default.rules['no-array-constructor'],
52
- // Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version
53
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
54
- 'no-dupe-class-members': 'off',
55
- '@typescript-eslint/no-dupe-class-members': es6_1.default.rules['no-dupe-class-members'],
56
- // Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version
57
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
127
+ // Disallow using the delete operator on array values.
128
+ // https://typescript-eslint.io/rules/no-array-delete
129
+ '@typescript-eslint/no-array-delete': 'off',
130
+ // Require .toString() and .toLocaleString() to only be called on objects which provide useful information when stringified.
131
+ // https://typescript-eslint.io/rules/no-base-to-string
132
+ '@typescript-eslint/no-base-to-string': 'off',
133
+ // Disallow non-null assertion in locations that may be confusing.
134
+ // https://typescript-eslint.io/rules/no-confusing-non-null-assertion
135
+ '@typescript-eslint/no-confusing-non-null-assertion': 'error',
136
+ // Require expressions of type void to appear in statement position.
137
+ // https://typescript-eslint.io/rules/no-confusing-void-expression
138
+ '@typescript-eslint/no-confusing-void-expression': 'off',
139
+ // Disallow using code marked as @deprecated.
140
+ // https://typescript-eslint.io/rules/no-deprecated
141
+ '@typescript-eslint/no-deprecated': 'off',
142
+ // Disallow duplicate class members.
143
+ // https://typescript-eslint.io/rules/no-dupe-class-members
144
+ // Not recommended by the TypeScript Eslint team
145
+ '@typescript-eslint/no-dupe-class-members': 'off',
146
+ // Disallow duplicate enum member values.
147
+ // https://typescript-eslint.io/rules/no-duplicate-enum-values
148
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
149
+ // Disallow duplicate constituents of union or intersection types.
150
+ // https://typescript-eslint.io/rules/no-duplicate-type-constituents
151
+ '@typescript-eslint/no-duplicate-type-constituents': 'off',
152
+ // Disallow using the delete operator on computed key expressions.
153
+ // https://typescript-eslint.io/rules/no-dynamic-delete
154
+ '@typescript-eslint/no-dynamic-delete': 'off',
155
+ // Disallow empty functions.
156
+ // https://typescript-eslint.io/rules/no-empty-function
58
157
  'no-empty-function': 'off',
59
158
  '@typescript-eslint/no-empty-function': best_practices_1.default.rules['no-empty-function'],
60
- // Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
61
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
159
+ // Disallow accidentally using the "empty object" type.
160
+ // https://typescript-eslint.io/rules/no-empty-object-type
161
+ '@typescript-eslint/no-empty-object-type': [
162
+ 'error',
163
+ {
164
+ allowInterfaces: 'never',
165
+ allowObjectTypes: 'never',
166
+ },
167
+ ],
168
+ // Disallow the any type.
169
+ // https://typescript-eslint.io/rules/no-explicit-any
170
+ // Recommended by the TypeScript Eslint team
171
+ '@typescript-eslint/no-explicit-any': 'off',
172
+ // Disallow extra non-null assertions.
173
+ // https://typescript-eslint.io/rules/no-extra-non-null-assertion
174
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
175
+ // Disallow classes used as namespaces.
176
+ // https://typescript-eslint.io/rules/no-extraneous-class
177
+ '@typescript-eslint/no-extraneous-class': 'off',
178
+ // Require Promise-like statements to be handled appropriately.
179
+ // https://typescript-eslint.io/rules/no-floating-promises
180
+ '@typescript-eslint/no-floating-promises': 'off',
181
+ // Disallow iterating over an array with a for-in loop.
182
+ // https://typescript-eslint.io/rules/no-for-in-array
183
+ '@typescript-eslint/no-for-in-array': 'error',
184
+ // Disallow the use of eval()-like functions.
185
+ // https://typescript-eslint.io/rules/no-implied-eval
62
186
  'no-implied-eval': 'off',
63
187
  'no-new-func': 'off',
64
188
  '@typescript-eslint/no-implied-eval': best_practices_1.default.rules['no-implied-eval'],
65
- // Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
66
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
189
+ // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
190
+ // https://typescript-eslint.io/rules/no-import-type-side-effects
191
+ '@typescript-eslint/no-import-type-side-effects': 'off',
192
+ // Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean.
193
+ // https://typescript-eslint.io/rules/no-inferrable-types
194
+ '@typescript-eslint/no-inferrable-types': [
195
+ 'error',
196
+ {
197
+ ignoreParameters: false,
198
+ ignoreProperties: false,
199
+ },
200
+ ],
201
+ // Disallow this keywords outside of classes or class-like objects.
202
+ // https://typescript-eslint.io/rules/no-invalid-this
203
+ '@typescript-eslint/no-invalid-this': 'off',
204
+ // Disallow void type outside of generic or return types.
205
+ // https://typescript-eslint.io/rules/no-invalid-void-type
206
+ '@typescript-eslint/no-invalid-void-type': 'off',
207
+ // Disallow function declarations that contain unsafe references inside loop statements.
208
+ // https://typescript-eslint.io/rules/no-loop-func
67
209
  'no-loop-func': 'off',
68
210
  '@typescript-eslint/no-loop-func': best_practices_1.default.rules['no-loop-func'],
69
- // Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version
70
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
71
- 'no-magic-numbers': 'off',
72
- '@typescript-eslint/no-magic-numbers': best_practices_1.default.rules['no-magic-numbers'],
73
- // Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version
74
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
75
- 'no-redeclare': 'off',
76
- '@typescript-eslint/no-redeclare': best_practices_1.default.rules['no-redeclare'],
77
- // Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version
78
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
211
+ // Disallow magic numbers.
212
+ // https://typescript-eslint.io/rules/no-magic-numbers
213
+ '@typescript-eslint/no-magic-numbers': 'off',
214
+ // Disallow the void operator except when used to discard a value.
215
+ // https://typescript-eslint.io/rules/no-meaningless-void-operator
216
+ '@typescript-eslint/no-meaningless-void-operator': 'off',
217
+ // Enforce valid definition of new and constructor.
218
+ // https://typescript-eslint.io/rules/no-misused-new
219
+ '@typescript-eslint/no-misused-new': 'error',
220
+ // Disallow Promises in places not designed to handle them.
221
+ // https://typescript-eslint.io/rules/no-misused-promises
222
+ '@typescript-eslint/no-misused-promises': 'off',
223
+ // Disallow using the spread operator when it might cause unexpected behavior.
224
+ // https://typescript-eslint.io/rules/no-misused-spread
225
+ '@typescript-eslint/no-misused-spread': 'off',
226
+ // Disallow enums from having both number and string members.
227
+ // https://typescript-eslint.io/rules/no-mixed-enums
228
+ '@typescript-eslint/no-mixed-enums': 'error',
229
+ // Disallow TypeScript namespaces.
230
+ // https://typescript-eslint.io/rules/no-namespace
231
+ '@typescript-eslint/no-namespace': [
232
+ 'error',
233
+ {
234
+ allowDeclarations: false,
235
+ allowDefinitionFiles: true,
236
+ },
237
+ ],
238
+ // Disallow non-null assertions in the left operand of a nullish coalescing operator.
239
+ // https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
240
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'off',
241
+ // Disallow non-null assertions after an optional chain expression.
242
+ // https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
243
+ // Recommended by the TypeScript Eslint team
244
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
245
+ // Disallow non-null assertions using the ! postfix operator.
246
+ // https://typescript-eslint.io/rules/no-non-null-assertion
247
+ '@typescript-eslint/no-non-null-assertion': 'off',
248
+ // Disallow variable redeclaration.
249
+ // https://typescript-eslint.io/rules/no-redeclare
250
+ '@typescript-eslint/no-redeclare': 'off',
251
+ // Disallow members of unions and intersections that do nothing or override type information.
252
+ // https://typescript-eslint.io/rules/no-redundant-type-constituents
253
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
254
+ // Disallow invocation of require().
255
+ // https://typescript-eslint.io/rules/no-require-imports
256
+ '@typescript-eslint/no-require-imports': [
257
+ 'error',
258
+ {
259
+ allow: [],
260
+ allowAsImport: false,
261
+ },
262
+ ],
263
+ // Disallow specified modules when loaded by import.
264
+ // https://typescript-eslint.io/rules/no-restricted-imports
265
+ '@typescript-eslint/no-restricted-imports': 'off',
266
+ // Disallow certain types.
267
+ // https://typescript-eslint.io/rules/no-restricted-types
268
+ '@typescript-eslint/no-restricted-types': 'off',
269
+ // Disallow variable declarations from shadowing variables declared in the outer scope.
270
+ // https://typescript-eslint.io/rules/no-shadow
79
271
  'no-shadow': 'off',
80
272
  '@typescript-eslint/no-shadow': variables_1.default.rules['no-shadow'],
81
- // Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
82
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
83
- 'no-throw-literal': 'off',
84
- '@typescript-eslint/only-throw-error': best_practices_1.default.rules['no-throw-literal'],
85
- // Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
86
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
273
+ // Disallow aliasing this.
274
+ // https://typescript-eslint.io/rules/no-this-alias
275
+ '@typescript-eslint/no-this-alias': [
276
+ 'error',
277
+ {
278
+ allowDestructuring: true,
279
+ allowedNames: ['self', 'that'],
280
+ },
281
+ ],
282
+ // Disallow unnecessary equality comparisons against boolean literals.
283
+ // https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
284
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
285
+ // Disallow conditionals where the type is always truthy or always falsy.
286
+ // https://typescript-eslint.io/rules/no-unnecessary-condition
287
+ '@typescript-eslint/no-unnecessary-condition': 'off',
288
+ // Disallow unnecessary assignment of constructor property parameter.
289
+ // https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
290
+ '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
291
+ // Disallow unnecessary namespace qualifiers.
292
+ // https://typescript-eslint.io/rules/no-unnecessary-qualifier
293
+ '@typescript-eslint/no-unnecessary-qualifier': 'error',
294
+ // Disallow unnecessary template expressions.
295
+ // https://typescript-eslint.io/rules/no-unnecessary-template-expression
296
+ '@typescript-eslint/no-unnecessary-template-expression': 'error',
297
+ // Disallow type arguments that are equal to the default.
298
+ // https://typescript-eslint.io/rules/no-unnecessary-type-arguments
299
+ '@typescript-eslint/no-unnecessary-type-arguments': 'error',
300
+ // Disallow type assertions that do not change the type of an expression.
301
+ // https://typescript-eslint.io/rules/no-unnecessary-type-assertion
302
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
303
+ // Disallow unnecessary constraints on generic types.
304
+ // https://typescript-eslint.io/rules/no-unnecessary-type-constraint
305
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
306
+ // Disallow type parameters that aren't used multiple times.
307
+ // https://typescript-eslint.io/rules/no-unnecessary-type-parameters
308
+ '@typescript-eslint/no-unnecessary-type-parameters': 'off',
309
+ // Disallow calling a function with a value with type any.
310
+ // https://typescript-eslint.io/rules/no-unsafe-argument
311
+ '@typescript-eslint/no-unsafe-argument': 'off',
312
+ // Disallow assigning a value with type any to variables and properties.
313
+ // https://typescript-eslint.io/rules/no-unsafe-assignment
314
+ '@typescript-eslint/no-unsafe-assignment': 'off',
315
+ // Disallow calling a value with type any.
316
+ // https://typescript-eslint.io/rules/no-unsafe-call
317
+ '@typescript-eslint/no-unsafe-call': 'off',
318
+ // Disallow unsafe declaration merging.
319
+ // https://typescript-eslint.io/rules/no-unsafe-declaration-merging
320
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
321
+ // Disallow comparing an enum value with a non-enum value.
322
+ // https://typescript-eslint.io/rules/no-unsafe-enum-comparison
323
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
324
+ // Disallow using the unsafe built-in Function type.
325
+ // https://typescript-eslint.io/rules/no-unsafe-function-type
326
+ '@typescript-eslint/no-unsafe-function-type': 'error',
327
+ // Disallow member access on a value with type any.
328
+ // https://typescript-eslint.io/rules/no-unsafe-member-access
329
+ '@typescript-eslint/no-unsafe-member-access': 'off',
330
+ // Disallow returning a value with type any from a function.
331
+ // https://typescript-eslint.io/rules/no-unsafe-return
332
+ '@typescript-eslint/no-unsafe-return': 'off',
333
+ // Disallow type assertions that narrow a type.
334
+ // https://typescript-eslint.io/rules/no-unsafe-type-assertion
335
+ '@typescript-eslint/no-unsafe-type-assertion': 'off',
336
+ // Require unary negation to take a number.
337
+ // https://typescript-eslint.io/rules/no-unsafe-unary-minus
338
+ '@typescript-eslint/no-unsafe-unary-minus': 'error',
339
+ // Disallow unused expressions.
340
+ // https://typescript-eslint.io/rules/no-unused-expressions
87
341
  'no-unused-expressions': 'off',
88
342
  '@typescript-eslint/no-unused-expressions': best_practices_1.default.rules['no-unused-expressions'],
89
- // Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version
90
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
343
+ // Disallow unused variables.
344
+ // https://typescript-eslint.io/rules/no-unused-vars
91
345
  'no-unused-vars': 'off',
92
346
  '@typescript-eslint/no-unused-vars': variables_1.default.rules['no-unused-vars'],
93
- // Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version
94
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
347
+ // Disallow the use of variables before they are defined.
348
+ // https://typescript-eslint.io/rules/no-use-before-define
95
349
  'no-use-before-define': 'off',
96
350
  '@typescript-eslint/no-use-before-define': variables_1.default.rules['no-use-before-define'],
97
- // Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version
98
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
351
+ // Disallow unnecessary constructors.
352
+ // https://typescript-eslint.io/rules/no-useless-constructor
99
353
  'no-useless-constructor': 'off',
100
354
  '@typescript-eslint/no-useless-constructor': es6_1.default.rules['no-useless-constructor'],
101
- // Replace Airbnb 'require-await' rule with '@typescript-eslint' version
102
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
103
- 'require-await': 'off',
104
- '@typescript-eslint/require-await': best_practices_1.default.rules['require-await'],
105
- // Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
106
- // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
107
- // Its Base rule is deprecated
355
+ // Disallow empty exports that don't change anything in a module file.
356
+ // https://typescript-eslint.io/rules/no-useless-empty-export
357
+ '@typescript-eslint/no-useless-empty-export': 'off',
358
+ // Disallow using confusing built-in primitive class wrappers.
359
+ // https://typescript-eslint.io/rules/no-wrapper-object-types
360
+ '@typescript-eslint/no-wrapper-object-types': 'error',
361
+ // Enforce non-null assertions over explicit type assertions.
362
+ // https://typescript-eslint.io/rules/non-nullable-type-assertion-style
363
+ '@typescript-eslint/non-nullable-type-assertion-style': 'off',
364
+ // Disallow throwing non-Error values as exceptions.
365
+ // https://typescript-eslint.io/rules/only-throw-error
366
+ 'no-throw-literal': 'off',
367
+ '@typescript-eslint/only-throw-error': best_practices_1.default.rules['no-throw-literal'],
368
+ // Require or disallow parameter properties in class constructors.
369
+ // https://typescript-eslint.io/rules/parameter-properties
370
+ '@typescript-eslint/parameter-properties': 'off',
371
+ // Enforce the use of as const over literal type.
372
+ // https://typescript-eslint.io/rules/prefer-as-const
373
+ '@typescript-eslint/prefer-as-const': 'error',
374
+ // Require destructuring from arrays and/or objects.
375
+ // https://typescript-eslint.io/rules/prefer-destructuring
376
+ 'prefer-destructuring': 'off',
377
+ '@typescript-eslint/prefer-destructuring': es6_1.default.rules['prefer-destructuring'],
378
+ // Require each enum member value to be explicitly initialized.
379
+ // https://typescript-eslint.io/rules/prefer-enum-initializers
380
+ '@typescript-eslint/prefer-enum-initializers': 'off',
381
+ // Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
382
+ // https://typescript-eslint.io/rules/prefer-find
383
+ '@typescript-eslint/prefer-find': 'error',
384
+ // Enforce the use of for-of loop over the standard for loop where possible.
385
+ // https://typescript-eslint.io/rules/prefer-for-of
386
+ // Recommended in stylistic by the TypeScript Eslint team
387
+ '@typescript-eslint/prefer-for-of': 'off',
388
+ // Enforce using function types instead of interfaces with call signatures.
389
+ // https://typescript-eslint.io/rules/prefer-function-type
390
+ '@typescript-eslint/prefer-function-type': 'error',
391
+ // Enforce includes method over indexOf method.
392
+ // https://typescript-eslint.io/rules/prefer-includes
393
+ '@typescript-eslint/prefer-includes': 'off',
394
+ // Require all enum members to be literal values.
395
+ // https://typescript-eslint.io/rules/prefer-literal-enum-member
396
+ '@typescript-eslint/prefer-literal-enum-member': 'off',
397
+ // Require using the namespace keyword over module keyword to declare custom TypeScript modules.
398
+ // https://typescript-eslint.io/rules/prefer-namespace-keyword
399
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
400
+ // Enforce using the nullish coalescing operator instead of logical assignments or chaining.
401
+ // https://typescript-eslint.io/rules/prefer-nullish-coalescing
402
+ '@typescript-eslint/prefer-nullish-coalescing': 'off',
403
+ // Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.
404
+ // https://typescript-eslint.io/rules/prefer-optional-chain
405
+ '@typescript-eslint/prefer-optional-chain': 'off',
406
+ // Require using Error objects as Promise rejection reasons.
407
+ // https://typescript-eslint.io/rules/prefer-promise-reject-errors
408
+ '@typescript-eslint/prefer-promise-reject-errors': 'off',
409
+ // Require private members to be marked as readonly if they're never modified outside of the constructor.
410
+ // https://typescript-eslint.io/rules/prefer-readonly
411
+ '@typescript-eslint/prefer-readonly': 'off',
412
+ // Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
413
+ // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
414
+ '@typescript-eslint/prefer-readonly-parameter-types': 'off',
415
+ // Enforce using type parameter when calling Array#reduce instead of using a type assertion.
416
+ // https://typescript-eslint.io/rules/prefer-reduce-type-parameter
417
+ '@typescript-eslint/prefer-reduce-type-parameter': 'off',
418
+ // Enforce RegExp#exec over String#match if no global flag is provided.
419
+ // https://typescript-eslint.io/rules/prefer-regexp-exec
420
+ '@typescript-eslint/prefer-regexp-exec': 'off',
421
+ // Enforce that this is used when only this type is returned.
422
+ // https://typescript-eslint.io/rules/prefer-return-this-type
423
+ '@typescript-eslint/prefer-return-this-type': 'off',
424
+ // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.
425
+ // https://typescript-eslint.io/rules/prefer-string-starts-ends-with
426
+ '@typescript-eslint/prefer-string-starts-ends-with': 'off',
427
+ // Require any function or method that returns a Promise to be marked async.
428
+ // https://typescript-eslint.io/rules/promise-function-async
429
+ '@typescript-eslint/promise-function-async': 'off',
430
+ // Enforce that get() types should be assignable to their equivalent set() type.
431
+ // https://typescript-eslint.io/rules/related-getter-setter-pairs
432
+ '@typescript-eslint/related-getter-setter-pairs': 'off',
433
+ // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
434
+ // https://typescript-eslint.io/rules/require-array-sort-compare
435
+ '@typescript-eslint/require-array-sort-compare': 'off',
436
+ // Disallow async functions which do not return promises and have no await expression.
437
+ // https://typescript-eslint.io/rules/require-await
438
+ '@typescript-eslint/require-await': 'off',
439
+ // Require both operands of addition to be the same type and be bigint, number, or string.
440
+ // https://typescript-eslint.io/rules/restrict-plus-operands
441
+ '@typescript-eslint/restrict-plus-operands': 'off',
442
+ // Enforce template literal expressions to be of string type.
443
+ // https://typescript-eslint.io/rules/restrict-template-expressions
444
+ '@typescript-eslint/restrict-template-expressions': 'off',
445
+ // Enforce consistent awaiting of returned promises.
446
+ // https://typescript-eslint.io/rules/return-await
108
447
  '@typescript-eslint/return-await': ['error', 'in-try-catch'],
448
+ // Disallow certain types in boolean expressions.
449
+ // https://typescript-eslint.io/rules/strict-boolean-expressions
450
+ '@typescript-eslint/strict-boolean-expressions': 'off',
451
+ // Require switch-case statements to be exhaustive.
452
+ // https://typescript-eslint.io/rules/switch-exhaustiveness-check
453
+ '@typescript-eslint/switch-exhaustiveness-check': 'off',
454
+ // Disallow certain triple slash directives in favor of ES6-style import declarations.
455
+ // https://typescript-eslint.io/rules/triple-slash-reference
456
+ '@typescript-eslint/triple-slash-reference': [
457
+ 'error',
458
+ {
459
+ lib: 'always',
460
+ path: 'never',
461
+ types: 'prefer-import',
462
+ },
463
+ ],
464
+ // Require type annotations in certain places.
465
+ // https://typescript-eslint.io/rules/typedef
466
+ '@typescript-eslint/typedef': 'off',
467
+ // Enforce unbound methods are called with their expected scope.
468
+ // https://typescript-eslint.io/rules/unbound-method
469
+ '@typescript-eslint/unbound-method': 'off',
470
+ // Disallow two overloads that could be unified into one with a union or an optional/rest parameter.
471
+ // https://typescript-eslint.io/rules/unified-signatures
472
+ '@typescript-eslint/unified-signatures': 'off',
473
+ // Enforce typing arguments in Promise rejection callbacks as unknown.
474
+ // https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
475
+ '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
476
+ },
477
+ };
478
+ exports.deprecatedTypescriptEslintRules = {
479
+ name: 'airbnb/config/typescript/typescript-eslint/deprecated',
480
+ rules: {
481
+ // Disallow the declaration of empty interfaces.
482
+ // https://typescript-eslint.io/rules/no-empty-interface
483
+ '@typescript-eslint/no-empty-interface': 'off',
484
+ // Disallow literal numbers that lose precision.
485
+ // https://typescript-eslint.io/rules/no-loss-of-precision
486
+ '@typescript-eslint/no-loss-of-precision': 'off',
487
+ // Disallow type aliases.
488
+ // https://typescript-eslint.io/rules/no-type-alias
489
+ '@typescript-eslint/no-type-alias': 'off',
490
+ // Disallow require statements except in import statements.
491
+ // https://typescript-eslint.io/rules/no-var-requires
492
+ '@typescript-eslint/no-var-requires': 'off',
493
+ // Enforce using @ts-expect-error over @ts-ignore.
494
+ // https://typescript-eslint.io/rules/prefer-ts-expect-error
495
+ '@typescript-eslint/prefer-ts-expect-error': 'off',
496
+ // Enforce constituents of a type union/intersection to be sorted alphabetically.
497
+ // https://typescript-eslint.io/rules/sort-type-constituents
498
+ '@typescript-eslint/sort-type-constituents': 'off',
109
499
  },
110
500
  };
111
501
  exports.default = typescriptEslintRules;
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../../utils");
4
+ const typescriptEslintStrictRules = {
5
+ name: 'airbnb/config/typescript/typescript-eslint/strict',
6
+ files: utils_1.tsFiles,
7
+ rules: {
8
+ // Require that function overload signatures be consecutive.
9
+ // https://typescript-eslint.io/rules/adjacent-overload-signatures
10
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
11
+ // Disallow awaiting a value that is not a Thenable.
12
+ // https://typescript-eslint.io/rules/await-thenable
13
+ '@typescript-eslint/await-thenable': 'error',
14
+ // Disallow @ts-<directive> comments or require descriptions after directives.
15
+ // https://typescript-eslint.io/rules/ban-ts-comment
16
+ '@typescript-eslint/ban-ts-comment': [
17
+ 'error',
18
+ {
19
+ minimumDescriptionLength: 3,
20
+ 'ts-check': false,
21
+ 'ts-expect-error': 'allow-with-description',
22
+ 'ts-ignore': true,
23
+ 'ts-nocheck': true,
24
+ },
25
+ ],
26
+ // Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.
27
+ // https://typescript-eslint.io/rules/consistent-generic-constructors
28
+ '@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
29
+ // Enforce consistent usage of type assertions.
30
+ // https://typescript-eslint.io/rules/consistent-type-assertions
31
+ '@typescript-eslint/consistent-type-assertions': [
32
+ 'error',
33
+ {
34
+ arrayLiteralTypeAssertions: 'allow',
35
+ assertionStyle: 'as',
36
+ objectLiteralTypeAssertions: 'allow',
37
+ },
38
+ ],
39
+ // Enforce consistent usage of type exports.
40
+ // https://typescript-eslint.io/rules/consistent-type-exports
41
+ '@typescript-eslint/consistent-type-exports': [
42
+ 'error',
43
+ {
44
+ fixMixedExportsWithInlineTypeSpecifier: false,
45
+ },
46
+ ],
47
+ // Enforce consistent usage of type imports.
48
+ // https://typescript-eslint.io/rules/consistent-type-imports
49
+ '@typescript-eslint/consistent-type-imports': [
50
+ 'error',
51
+ {
52
+ disallowTypeAnnotations: true,
53
+ fixStyle: 'separate-type-imports',
54
+ prefer: 'type-imports',
55
+ },
56
+ ],
57
+ // Require explicit return and argument types on exported functions' and classes' public class methods.
58
+ // https://typescript-eslint.io/rules/explicit-module-boundary-types
59
+ '@typescript-eslint/explicit-module-boundary-types': [
60
+ 'error',
61
+ {
62
+ allowArgumentsExplicitlyTypedAsAny: false,
63
+ allowDirectConstAssertionInArrowFunctions: true,
64
+ allowedNames: [],
65
+ allowHigherOrderFunctions: true,
66
+ allowOverloadFunctions: false,
67
+ allowTypedFunctionExpressions: true,
68
+ },
69
+ ],
70
+ // Enforce using a particular method signature syntax.
71
+ // https://typescript-eslint.io/rules/method-signature-style
72
+ '@typescript-eslint/method-signature-style': ['error', 'property'],
73
+ // Disallow using the delete operator on array values.
74
+ // https://typescript-eslint.io/rules/no-array-delete
75
+ '@typescript-eslint/no-array-delete': 'error',
76
+ // Require expressions of type void to appear in statement position.
77
+ // https://typescript-eslint.io/rules/no-confusing-void-expression
78
+ '@typescript-eslint/no-confusing-void-expression': [
79
+ 'error',
80
+ {
81
+ ignoreArrowShorthand: false,
82
+ ignoreVoidOperator: true,
83
+ ignoreVoidReturningFunctions: false,
84
+ },
85
+ ],
86
+ // Disallow duplicate constituents of union or intersection types.
87
+ // https://typescript-eslint.io/rules/no-duplicate-type-constituents
88
+ '@typescript-eslint/no-duplicate-type-constituents': [
89
+ 'error',
90
+ {
91
+ ignoreIntersections: false,
92
+ ignoreUnions: false,
93
+ },
94
+ ],
95
+ // Disallow the any type.
96
+ // https://typescript-eslint.io/rules/no-explicit-any
97
+ '@typescript-eslint/no-explicit-any': [
98
+ 'error',
99
+ {
100
+ fixToUnknown: false,
101
+ ignoreRestArgs: false,
102
+ },
103
+ ],
104
+ // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
105
+ // https://typescript-eslint.io/rules/no-import-type-side-effects
106
+ '@typescript-eslint/no-import-type-side-effects': 'error',
107
+ // Disallow void type outside of generic or return types.
108
+ // https://typescript-eslint.io/rules/no-invalid-void-type
109
+ '@typescript-eslint/no-invalid-void-type': [
110
+ 'error',
111
+ {
112
+ allowAsThisParameter: false,
113
+ allowInGenericTypeArguments: true,
114
+ },
115
+ ],
116
+ // Disallow the void operator except when used to discard a value.
117
+ // https://typescript-eslint.io/rules/no-meaningless-void-operator
118
+ '@typescript-eslint/no-meaningless-void-operator': [
119
+ 'error',
120
+ {
121
+ checkNever: false,
122
+ },
123
+ ],
124
+ // Disallow Promises in places not designed to handle them.
125
+ // https://typescript-eslint.io/rules/no-misused-promises
126
+ '@typescript-eslint/no-misused-promises': [
127
+ 'error',
128
+ {
129
+ checksConditionals: true,
130
+ checksSpreads: true,
131
+ checksVoidReturn: true,
132
+ },
133
+ ],
134
+ // Disallow using the spread operator when it might cause unexpected behavior.
135
+ // https://typescript-eslint.io/rules/no-misused-spread
136
+ '@typescript-eslint/no-misused-spread': [
137
+ 'error',
138
+ {
139
+ allow: [],
140
+ },
141
+ ],
142
+ // Disallow non-null assertions in the left operand of a nullish coalescing operator.
143
+ // https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
144
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'warn',
145
+ // Disallow non-null assertions after an optional chain expression.
146
+ // https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
147
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
148
+ // Disallow non-null assertions using the ! postfix operator.
149
+ // https://typescript-eslint.io/rules/no-non-null-assertion
150
+ '@typescript-eslint/no-non-null-assertion': 'error',
151
+ // Disallow members of unions and intersections that do nothing or override type information.
152
+ // https://typescript-eslint.io/rules/no-redundant-type-constituents
153
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
154
+ // Disallow unnecessary equality comparisons against boolean literals.
155
+ // https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
156
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
157
+ // Disallow assigning a value with type any to variables and properties.
158
+ // https://typescript-eslint.io/rules/no-unsafe-assignment
159
+ '@typescript-eslint/no-unsafe-assignment': 'error',
160
+ // Disallow calling a value with type any.
161
+ // https://typescript-eslint.io/rules/no-unsafe-call
162
+ '@typescript-eslint/no-unsafe-call': 'error',
163
+ // Disallow returning a value with type any from a function.
164
+ // https://typescript-eslint.io/rules/no-unsafe-return
165
+ '@typescript-eslint/no-unsafe-return': 'error',
166
+ // Disallow empty exports that don't change anything in a module file.
167
+ // https://typescript-eslint.io/rules/no-useless-empty-export
168
+ '@typescript-eslint/no-useless-empty-export': 'error',
169
+ // Enforce the use of for-of loop over the standard for loop where possible.
170
+ // https://typescript-eslint.io/rules/prefer-for-of
171
+ '@typescript-eslint/prefer-for-of': 'off',
172
+ // Enforce includes method over indexOf method.
173
+ // https://typescript-eslint.io/rules/prefer-includes
174
+ '@typescript-eslint/prefer-includes': 'warn',
175
+ // Enforce using the nullish coalescing operator instead of logical assignments or chaining.
176
+ // https://typescript-eslint.io/rules/prefer-nullish-coalescing
177
+ '@typescript-eslint/prefer-nullish-coalescing': 'error',
178
+ // Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.
179
+ // https://typescript-eslint.io/rules/prefer-optional-chain
180
+ '@typescript-eslint/prefer-optional-chain': 'error',
181
+ // Enforce using type parameter when calling Array#reduce instead of using a type assertion.
182
+ // https://typescript-eslint.io/rules/prefer-reduce-type-parameter
183
+ '@typescript-eslint/prefer-reduce-type-parameter': 'error',
184
+ // Enforce RegExp#exec over String#match if no global flag is provided.
185
+ // https://typescript-eslint.io/rules/prefer-regexp-exec
186
+ '@typescript-eslint/prefer-regexp-exec': 'error',
187
+ // Enforce using String#startsWith and String#endsWith over other equivalent methods of checking substrings.
188
+ // https://typescript-eslint.io/rules/prefer-string-starts-ends-with
189
+ '@typescript-eslint/prefer-string-starts-ends-with': 'warn',
190
+ // Require any function or method that returns a Promise to be marked async.
191
+ // https://typescript-eslint.io/rules/promise-function-async
192
+ '@typescript-eslint/promise-function-async': 'error',
193
+ // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
194
+ // https://typescript-eslint.io/rules/require-array-sort-compare
195
+ '@typescript-eslint/require-array-sort-compare': 'error',
196
+ // Disallow two overloads that could be unified into one with a union or an optional/rest parameter.
197
+ // https://typescript-eslint.io/rules/unified-signatures
198
+ '@typescript-eslint/unified-signatures': [
199
+ 'error',
200
+ {
201
+ ignoreDifferentlyNamedParameters: false,
202
+ ignoreOverloadsWithDifferentJSDoc: false,
203
+ },
204
+ ],
205
+ },
206
+ };
207
+ exports.default = typescriptEslintStrictRules;
@@ -43,11 +43,12 @@ const variablesRules = {
43
43
  'no-undefined': 'off',
44
44
  // disallow declaration of variables that are not used in the code
45
45
  'no-unused-vars': [
46
- 'error',
46
+ 'warn',
47
47
  {
48
48
  vars: 'all',
49
49
  args: 'after-used',
50
50
  ignoreRestSiblings: true,
51
+ argsIgnorePattern: '^_',
51
52
  },
52
53
  ],
53
54
  // disallow use of variables before they are defined
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tsExtensionsRule = exports.tsExtensionsResolver = exports.tsExtensionsWithReactDTS = exports.tsExtensionsWithReact = exports.tsExtensions = exports.jsExtensionsRule = exports.jsExtensionsResolver = exports.jsExtensionsWithReact = exports.jsExtensions = void 0;
3
+ exports.tsFiles = exports.tsExtensionsRule = exports.tsExtensionsResolver = exports.tsExtensionsWithReactDTS = exports.tsExtensionsWithReact = exports.tsExtensions = exports.jsExtensionsRule = exports.jsExtensionsResolver = exports.jsExtensionsWithReact = exports.jsExtensions = void 0;
4
4
  exports.jsExtensions = ['.js', '.cjs', '.mjs'];
5
5
  exports.jsExtensionsWithReact = [...exports.jsExtensions, '.jsx'];
6
6
  exports.jsExtensionsResolver = [...exports.jsExtensions, '.json'];
@@ -10,3 +10,5 @@ exports.tsExtensionsWithReact = [...exports.tsExtensions, '.tsx'];
10
10
  exports.tsExtensionsWithReactDTS = [...exports.tsExtensionsWithReact, '.d.ts'];
11
11
  exports.tsExtensionsResolver = [exports.tsExtensions, '.d.ts'];
12
12
  exports.tsExtensionsRule = Object.fromEntries(Object.values(exports.tsExtensionsWithReact).map((val) => [val.slice(1), 'never']));
13
+ // ESLINT CONFIG FILES
14
+ exports.tsFiles = exports.tsExtensionsWithReact.map((val) => `*${val}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-airbnb-extended",
3
- "version": "0.10.2",
3
+ "version": "0.11.1",
4
4
  "description": "Eslint Airbnb Config Extended",
5
5
  "keywords": [
6
6
  "eslint",