{"name":"eslint-plugin-unused-imports","version":"4.0.1","keywords":["eslint","eslintplugin","eslint-plugin","import","unused","modules","autofix"],"author":{"name":"Mikkel Holmer Pedersen"},"license":"MIT","_id":"eslint-plugin-unused-imports@4.0.1","maintainers":[{"name":"sweepline","email":"mikkel@holmerp.dk"}],"homepage":"https://github.com/sweepline/eslint-plugin-unused-imports","bugs":{"url":"https://github.com/sweepline/eslint-plugin-unused-imports/issues"},"dist":{"shasum":"b78916ecb82ae6d0f54efb33879c6c7ecb52f080","tarball":"http://registry-npm.ywwl.com/eslint-plugin-unused-imports/download/eslint-plugin-unused-imports-4.0.1.tgz","fileCount":17,"integrity":"sha512-rax76s05z64uQgG9YXsWFmXrgjkaK79AvfeAWiSxhPP6RVGxeRaj4+2u+wxxu/mDy2pmJoOy1QTOEALMia2xGQ==","signatures":[{"sig":"MEYCIQDeN3nF3fTNREq58YAD4jMm9NHJCiWds+ITbbik4HMoBQIhAK6uMr1C71V+03hnEt3RkYqxtfKrBhe3Tian6zaY0PyS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15590,"size":5630,"noattachment":false,"key":"/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.0.1.tgz"},"main":"lib/index.js","engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"gitHead":"38cdd89e581856bd30a18eccbcb7fd8696d2d570","scripts":{"test":"jest","format":"prettier --write 'lib/**/*.js'"},"_npmUser":{"name":"sweepline","email":"mikkel@holmerp.dk"},"repository":{"url":"git+https://github.com/sweepline/eslint-plugin-unused-imports.git","type":"git"},"_npmVersion":"10.8.2","description":"Report and remove unused es6 modules","directories":{},"_nodeVersion":"18.20.4","dependencies":{"eslint-rule-composer":"^0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.3.0","ts-jest":"^29.1.2","prettier":"^3.2.5","@typescript-eslint/parser":"8.0.0-alpha.16","@typescript-eslint/eslint-plugin":"8.0.0-alpha.16"},"peerDependencies":{"eslint":"^9.0.0","@typescript-eslint/eslint-plugin":"^8.0.0-0"},"peerDependenciesMeta":{"@typescript-eslint/eslint-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-unused-imports_4.0.1_1721656051924_0.012082577645755821","host":"s3://npm-registry-packages"},"readme":"# eslint-plugin-unused-imports\n\nFind and remove unused es6 module imports. It works by splitting up the `no-unused-vars` rule depending on it being an import statement in the AST and providing an autofix rule to remove the nodes if they are imports. This plugin composes the rule `no-unused-vars` of either the typescript or js plugin so be aware that the other plugins needs to be installed and reporting correctly for this to do so.\n\n## _Versions_\n\n-   Version 4.1.x is for eslint 9 with @typescript-eslint/eslint-plugin 5 - 8\n-   Version 4.0.x is for eslint 9 with @typescript-eslint/eslint-plugin 8\n-   Version 3.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 6 - 7\n-   Version 2.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 5\n-   Version 1.x.x is for eslint 6 and 7.\n\n## Typescript\n\nIf running typescript with [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) make sure to use both `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`.\n\n## React\n\nIf writing react code you need to install `eslint-plugin-react` and enable the two rules `react/jsx-uses-react` and `react/jsx-uses-vars`. Otherwise all imports for components will be reported unused.\n\n## Installation\n\nYou'll first need to install [ESLint](http://eslint.org) (and [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) if using typescript):\n\n```bash\nnpm i eslint --save-dev\n```\n\nNext, install `eslint-plugin-unused-imports`:\n\n```bash\nnpm install eslint-plugin-unused-imports --save-dev\n```\n\n**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-unused-imports` globally.\n\n## Usage\n\nAdd `unused-imports` to the plugins section of your `eslint.config.js` configuration file.\n\n```js\nimport unusedImports from \"eslint-plugin-unused-imports\";\n\nexport default [{\n    plugins: {\n        \"unused-imports\": unusedImports,\n    },\n    rules: {\n        \"no-unused-vars\": \"off\", // or \"@typescript-eslint/no-unused-vars\": \"off\",\n        \"unused-imports/no-unused-imports\": \"error\",\n        \"unused-imports/no-unused-vars\": [\n            \"warn\",\n            {\n                \"vars\": \"all\",\n                \"varsIgnorePattern\": \"^_\",\n                \"args\": \"after-used\",\n                \"argsIgnorePattern\": \"^_\",\n            },\n        ]\n    }\n}];\n```\n\n## Supported Rules\n\n-   `no-unused-imports`\n-   `no-unused-vars`\n","publish_time":1721656052100,"_cnpm_publish_time":1721656052100,"dist-tags":{"latest":"4.4.1"}}