Skip to content

Commit

Permalink
fix(eslint): fine-tune no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed May 24, 2024
1 parent dea188a commit 3ad71d0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions configs/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,28 @@ export default [
},
},
rules: {
'no-unused-vars': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
},

// JS and JSX files
{
files: ['**/*.js', '**/*.jsx'],
files: ['**/*.js?(x)'],
rules: {
// most of these rules are useful for JS but not TS because TS handles these better
// if it weren't for https://github.com/import-js/eslint-plugin-import/issues/2132
// we could enable this :(
// 'import/no-unresolved': 'error',
'no-unused-vars': [
'warn',
{
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^ignored',
},
],
},
},

Expand All @@ -57,6 +65,15 @@ export default [
.default,
},
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'after-used',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^ignored',
},
],
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
'@typescript-eslint/consistent-type-imports': [
'warn',
Expand Down

0 comments on commit 3ad71d0

Please sign in to comment.