From 022fe2553537227c64c9856191fd45ebc7016d76 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 8 Mar 2022 15:44:15 +0700 Subject: [PATCH] Disable the `@typescript-eslint/no-unused-vars` rule --- index.js | 23 ++++++++++++----------- readme.md | 6 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/index.js b/index.js index d9dbefa..4f21568 100644 --- a/index.js +++ b/index.js @@ -517,17 +517,18 @@ module.exports = { 'no-unused-expressions': 'off', '@typescript-eslint/no-unused-expressions': 'error', 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', - { - vars: 'all', - args: 'after-used', - ignoreRestSiblings: true, - argsIgnorePattern: /^_/.source, - caughtErrors: 'all', - caughtErrorsIgnorePattern: /^_$/.source - } - ], + // NOTE: TypeScript already catches unused variables. Let us know if there's something this rule catches that TypeScript does not. + // '@typescript-eslint/no-unused-vars': [ + // 'error', + // { + // vars: 'all', + // args: 'after-used', + // ignoreRestSiblings: true, + // argsIgnorePattern: /^_/.source, + // caughtErrors: 'all', + // caughtErrorsIgnorePattern: /^_$/.source + // } + // ], 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'error', 'object-curly-spacing': 'off', diff --git a/readme.md b/readme.md index 8eeed1e..09bb8be 100644 --- a/readme.md +++ b/readme.md @@ -2,12 +2,12 @@ > ESLint [shareable config](https://eslint.org/docs/developer-guide/shareable-configs.html) for TypeScript to be used with [eslint-config-xo](https://github.com/xojs/eslint-config-xo) -**This config assumes your project is [ESM](https://nodejs.org/api/esm.html).** +**This config assumes your project is [ESM](https://nodejs.org/api/esm.html) and that you use a [strict config](https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json).** ## Install -``` -$ npm install --save-dev eslint-config-xo eslint-config-xo-typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin +```sh +npm install --save-dev eslint-config-xo eslint-config-xo-typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin ``` ## Use with XO