Skip to content

Commit 9d91c09

Browse files
committed
fix: relax no-unused-vars to match TypeScript style of exempting names
Ref: https://typescript-eslint.io/rules/no-unused-vars/
1 parent e05233d commit 9d91c09

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

eslint.config.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ export default typescriptESLint.config(
7979
"no-unused-vars": [
8080
"error",
8181
{
82+
args: "all",
83+
argsIgnorePattern: "^_",
84+
caughtErrors: "all",
85+
caughtErrorsIgnorePattern: "^_",
86+
destructuredArrayIgnorePattern: "^_",
8287
varsIgnorePattern: "^_",
88+
ignoreRestSiblings: true,
8389
},
8490
],
8591
"no-use-before-define": [
@@ -272,19 +278,25 @@ export default typescriptESLint.config(
272278

273279
rules: {
274280
"no-undef": "off",
281+
275282
"no-dupe-class-members": "off",
276283
"@typescript-eslint/no-dupe-class-members": "error",
277-
"no-unused-vars": "off",
278284

285+
"no-unused-vars": "off",
279286
"@typescript-eslint/no-unused-vars": [
280287
"error",
281288
{
289+
args: "all",
290+
argsIgnorePattern: "^_",
291+
caughtErrors: "all",
292+
caughtErrorsIgnorePattern: "^_",
293+
destructuredArrayIgnorePattern: "^_",
282294
varsIgnorePattern: "^_",
295+
ignoreRestSiblings: true,
283296
},
284297
],
285298

286299
"no-use-before-define": "off",
287-
288300
"@typescript-eslint/no-use-before-define": [
289301
"error",
290302
{
@@ -298,12 +310,14 @@ export default typescriptESLint.config(
298310

299311
"default-param-last": "off",
300312
"@typescript-eslint/default-param-last": "error",
313+
301314
"no-array-constructor": "off",
302315
"@typescript-eslint/no-array-constructor": "error",
316+
303317
"no-implied-eval": "off",
304318
"@typescript-eslint/no-implied-eval": "error",
305-
"no-redeclare": "off",
306319

320+
"no-redeclare": "off",
307321
"@typescript-eslint/no-redeclare": [
308322
"error",
309323
{
@@ -313,8 +327,8 @@ export default typescriptESLint.config(
313327

314328
"no-throw-literal": "off",
315329
"@typescript-eslint/only-throw-error": "error",
316-
"no-unused-expressions": "off",
317330

331+
"no-unused-expressions": "off",
318332
"@typescript-eslint/no-unused-expressions": [
319333
"error",
320334
{
@@ -326,13 +340,14 @@ export default typescriptESLint.config(
326340

327341
"no-useless-constructor": "off",
328342
"@typescript-eslint/no-useless-constructor": "error",
329-
"@typescript-eslint/no-unnecessary-template-expression": "error",
330343

344+
"@typescript-eslint/no-unnecessary-template-expression": "error",
331345
"@typescript-eslint/adjacent-overload-signatures": "error",
332346

333347
"@typescript-eslint/no-unsafe-function-type": "error",
334348
"@typescript-eslint/no-wrapper-object-types": "error",
335349
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
350+
336351
"no-duplicate-imports": "off",
337352
"@typescript-eslint/consistent-type-imports": "error",
338353

@@ -411,6 +426,7 @@ export default typescriptESLint.config(
411426
"@typescript-eslint/prefer-reduce-type-parameter": "error",
412427
"@typescript-eslint/prefer-return-this-type": "error",
413428
"@typescript-eslint/promise-function-async": "error",
429+
414430
"prefer-promise-reject-errors": "off",
415431
"@typescript-eslint/prefer-promise-reject-errors": "error",
416432

0 commit comments

Comments
 (0)