Skip to content

Commit 063a054

Browse files
authored
feat: add unused-imports plugin (#230)
1 parent e11aea9 commit 063a054

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
globals: {
2020
globalThis: false, // false means not writable
2121
},
22-
plugins: ['ban', 'jsdoc', 'react', 'react-hooks', 'etc', 'rxjs', 'jest-dom', 'jsx-a11y'],
22+
plugins: ['ban', 'jsdoc', 'react', 'react-hooks', 'etc', 'rxjs', 'jest-dom', 'jsx-a11y', 'unused-imports'],
2323
settings: {
2424
react: {
2525
version: 'detect',
@@ -314,6 +314,9 @@ module.exports = {
314314
},
315315
},
316316
],
317+
318+
'unused-imports/no-unused-imports': 'error',
319+
'unused-imports/no-unused-vars': 'off',
317320
},
318321
overrides: [
319322
{

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"eslint-plugin-react": "^7.21.4",
4848
"eslint-plugin-react-hooks": "^4.2.0",
4949
"eslint-plugin-rxjs": "^2.1.5",
50-
"eslint-plugin-unicorn": "^21.0.0"
50+
"eslint-plugin-unicorn": "^21.0.0",
51+
"eslint-plugin-unused-imports": "^1.1.5"
5152
}
5253
}

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,18 @@ eslint-plugin-unicorn@^21.0.0:
20062006
safe-regex "^2.1.1"
20072007
semver "^7.3.2"
20082008

2009+
eslint-plugin-unused-imports@^1.1.5:
2010+
version "1.1.5"
2011+
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-1.1.5.tgz#a2b992ef0faf6c6c75c3815cc47bde76739513c2"
2012+
integrity sha512-TeV8l8zkLQrq9LBeYFCQmYVIXMjfHgdRQLw7dEZp4ZB3PeR10Y5Uif11heCsHRmhdRIYMoewr1d9ouUHLbLHew==
2013+
dependencies:
2014+
eslint-rule-composer "^0.3.0"
2015+
2016+
eslint-rule-composer@^0.3.0:
2017+
version "0.3.0"
2018+
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
2019+
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
2020+
20092021
eslint-scope@^5.1.1:
20102022
version "5.1.1"
20112023
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"

0 commit comments

Comments
 (0)