Skip to content

Commit

Permalink
Disable the @typescript-eslint/no-unused-vars rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 8, 2022
1 parent 5c4a2b5 commit 022fe25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 022fe25

Please sign in to comment.