Skip to content

Commit 91e818b

Browse files
pierrezimmermannbampierrezimmermann
andauthored
BREAKING CHANGE(eslint-plugin): add new rule for unused imports (#53)
Co-authored-by: pierrezimmermann <pierrez@nam.tech>
1 parent 5cfca6d commit 91e818b

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

packages/eslint-plugin/lib/configs/recommended.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = defineConfig({
2424
"plugin:react-hooks/recommended",
2525
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
2626
],
27-
plugins: ["@bam.tech"],
27+
plugins: ["@bam.tech", "unused-imports"],
2828
rules: {
2929
"@typescript-eslint/ban-ts-comment": "warn",
3030
"@typescript-eslint/explicit-function-return-type": "off",
@@ -40,6 +40,7 @@ module.exports = defineConfig({
4040
"react/no-unstable-nested-components": "error",
4141
"react/prop-types": "off",
4242
"react/no-unused-prop-types": "error",
43+
"unused-imports/no-unused-imports": "error",
4344
},
4445
env: {
4546
node: true,

packages/eslint-plugin/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"eslint-plugin-react-native": "^4.0.0",
3535
"eslint-plugin-react-native-a11y": "^3.3.0",
3636
"eslint-plugin-testing-library": "^6.0.1",
37+
"eslint-plugin-unused-imports": "^3.0.0",
3738
"prettier": "^2.8.8"
3839
},
3940
"dependencies": {
@@ -55,6 +56,7 @@
5556
"eslint-plugin-react-hooks": "^4.6.0",
5657
"eslint-plugin-react-native": "^4.0.0",
5758
"eslint-plugin-testing-library": "6.0.1",
59+
"eslint-plugin-unused-imports": "^3.0.0",
5860
"mocha": "^10.2.0",
5961
"npm-run-all": "^4.1.5",
6062
"prettier": "^2.8.8"

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,6 +5068,18 @@ eslint-plugin-testing-library@6.0.1, eslint-plugin-testing-library@^6.0.1:
50685068
dependencies:
50695069
"@typescript-eslint/utils" "^5.58.0"
50705070

5071+
eslint-plugin-unused-imports@^3.0.0:
5072+
version "3.0.0"
5073+
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.0.0.tgz#d25175b0072ff16a91892c3aa72a09ca3a9e69e7"
5074+
integrity sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==
5075+
dependencies:
5076+
eslint-rule-composer "^0.3.0"
5077+
5078+
eslint-rule-composer@^0.3.0:
5079+
version "0.3.0"
5080+
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
5081+
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
5082+
50715083
eslint-scope@^5.1.1:
50725084
version "5.1.1"
50735085
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz"

0 commit comments

Comments
 (0)