Skip to content

Commit 790a7f1

Browse files
committed
add eslint-plugin-unused-imports
1 parent 5a8ce0f commit 790a7f1

3 files changed

Lines changed: 66 additions & 3 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 & 3 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,
@@ -96,6 +96,19 @@ module.exports = {
9696
curly: ['error', 'all'],
9797
'object-shorthand': ['error'],
9898
eqeqeq: 'error',
99-
'arrow-body-style': 'error'
100-
}
99+
'arrow-body-style': 'error',
100+
101+
// Rules for eslint-plugin-unused-imports
102+
'@typescript-eslint/no-unused-vars': 'off',
103+
'unused-imports/no-unused-imports': 'error',
104+
'unused-imports/no-unused-vars': [
105+
'error',
106+
{
107+
ignoreRestSiblings: true,
108+
varsIgnorePattern: '^[iI]gnored',
109+
argsIgnorePattern: '^_',
110+
caughtErrorsIgnorePattern: '^ignore',
111+
},
112+
],
113+
},
101114
}

0 commit comments

Comments
 (0)