Skip to content

Commit 683371b

Browse files
committed
add eslint-plugin-unused-imports
1 parent 5a8ce0f commit 683371b

3 files changed

Lines changed: 66 additions & 12 deletions

File tree

package-lock.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"eslint-plugin-react": "^7.34.1",
6969
"eslint-plugin-react-hooks": "^4.6.0",
7070
"eslint-plugin-tailwindcss": "^3.15.1",
71+
"eslint-plugin-unused-imports": "^3.2.0",
7172
"prettier": "^3.2.5",
7273
"react": "^18.2.0",
7374
"react-dom": "^18.2.0"
@@ -84,6 +85,7 @@
8485
"eslint-plugin-react": "^7.33.0",
8586
"eslint-plugin-react-hooks": "^4.6.0",
8687
"eslint-plugin-tailwindcss": "^3.13.0",
88+
"eslint-plugin-unused-imports": "^3.2.0",
8789
"prettier": "^3.0.0"
8890
},
8991
"peerDependenciesMeta": {

ts.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
sourceType: 'module',
1313
ecmaVersion: 2020
1414
},
15-
plugins: ['@typescript-eslint'],
15+
plugins: ['@typescript-eslint', 'eslint-plugin-unused-imports'],
1616
env: {
1717
node: true,
1818
browser: true,
@@ -36,15 +36,6 @@ module.exports = {
3636
},
3737
],
3838
rules: {
39-
'@typescript-eslint/no-unused-vars': [
40-
'error',
41-
{
42-
ignoreRestSiblings: true,
43-
varsIgnorePattern: '^[iI]gnored',
44-
argsIgnorePattern: '^_',
45-
caughtErrorsIgnorePattern: '^ignore'
46-
}
47-
],
4839
'@typescript-eslint/member-delimiter-style': 'off',
4940
'@typescript-eslint/explicit-function-return-type': 'off',
5041
'@typescript-eslint/restrict-template-expressions': [
@@ -96,6 +87,19 @@ module.exports = {
9687
curly: ['error', 'all'],
9788
'object-shorthand': ['error'],
9889
eqeqeq: 'error',
99-
'arrow-body-style': 'error'
100-
}
90+
'arrow-body-style': 'error',
91+
92+
// Rules for eslint-plugin-unused-imports
93+
'@typescript-eslint/no-unused-vars': 'off',
94+
'unused-imports/no-unused-imports': 'error',
95+
'unused-imports/no-unused-vars': [
96+
'error',
97+
{
98+
ignoreRestSiblings: true,
99+
varsIgnorePattern: '^[iI]gnored',
100+
argsIgnorePattern: '^_',
101+
caughtErrorsIgnorePattern: '^ignore',
102+
},
103+
],
104+
},
101105
}

0 commit comments

Comments
 (0)