Skip to content

Commit 3ad71d0

Browse files
committed
fix(eslint): fine-tune no-unused-vars
1 parent dea188a commit 3ad71d0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

configs/eslint.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,28 @@ export default [
2626
},
2727
},
2828
rules: {
29-
'no-unused-vars': 'warn',
3029
'react-hooks/rules-of-hooks': 'error',
3130
'react-hooks/exhaustive-deps': 'warn',
3231
},
3332
},
3433

3534
// JS and JSX files
3635
{
37-
files: ['**/*.js', '**/*.jsx'],
36+
files: ['**/*.js?(x)'],
3837
rules: {
3938
// most of these rules are useful for JS but not TS because TS handles these better
4039
// if it weren't for https://github.com/import-js/eslint-plugin-import/issues/2132
4140
// we could enable this :(
4241
// 'import/no-unresolved': 'error',
42+
'no-unused-vars': [
43+
'warn',
44+
{
45+
args: 'after-used',
46+
argsIgnorePattern: '^_',
47+
ignoreRestSiblings: true,
48+
varsIgnorePattern: '^ignored',
49+
},
50+
],
4351
},
4452
},
4553

@@ -57,6 +65,15 @@ export default [
5765
.default,
5866
},
5967
rules: {
68+
'@typescript-eslint/no-unused-vars': [
69+
'warn',
70+
{
71+
args: 'after-used',
72+
argsIgnorePattern: '^_',
73+
ignoreRestSiblings: true,
74+
varsIgnorePattern: '^ignored',
75+
},
76+
],
6077
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
6178
'@typescript-eslint/consistent-type-imports': [
6279
'warn',

0 commit comments

Comments
 (0)