{"name":"eslint-plugin-unused-imports","version":"4.1.2","keywords":["eslint","eslintplugin","eslint-plugin","import","unused","modules","autofix"],"author":{"name":"Mikkel Holmer Pedersen"},"license":"MIT","_id":"eslint-plugin-unused-imports@4.1.2","maintainers":[{"name":"antfu","email":"anthonyfu117@hotmail.com"},{"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":"a1a9c9276869eb5c0a5c993386cfc09b73256bd2","tarball":"http://registry-npm.ywwl.com/eslint-plugin-unused-imports/download/eslint-plugin-unused-imports-4.1.2.tgz","fileCount":7,"integrity":"sha512-A/Ypb0DQlDEzIbcoAv87NpLLcG3iwlE0gBEpS9Ud/62v2v3CoO15lZ/WfGyo2Wq7YraWJ2aE0TeHgJcpor6KQQ==","signatures":[{"sig":"MEQCIAQ7Olh+7QZW6zNXUstVbzrm6LnB5EDu95R8+uuRWdjkAiBYRhCVC5P0RFE95nYckIALrPj4gKD7ErPoAfTeY2IFdg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15194,"size":4249,"noattachment":false,"key":"/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.2.tgz"},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"cdab8e0ac73be2ef31d085379709266efb4abd02","scripts":{"test":"vitest","build":"tsup","format":"prettier --write '**/*.[jt]s'","prepack":"npm run build","release":"bumpp && npm publish"},"_npmUser":{"name":"antfu","email":"anthonyfu117@hotmail.com"},"repository":{"url":"git+https://github.com/sweepline/eslint-plugin-unused-imports.git","type":"git"},"_npmVersion":"10.5.0","description":"Report and remove unused es6 modules","directories":{},"_nodeVersion":"20.12.2","_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","bumpp":"^9.4.2","eslint":"^9.8.0","vitest":"^2.0.5","prettier":"^3.3.3","typescript":"^5.5.4","@types/eslint":"^9.6.0","@typescript-eslint/utils":"^8.0.1","@typescript-eslint/parser":"^8.0.1","@typescript-eslint-v5/parser":"npm:@typescript-eslint/parser@^5","@typescript-eslint-v6/parser":"npm:@typescript-eslint/parser@^6","@typescript-eslint-v7/parser":"npm:@typescript-eslint/parser@^7","@typescript-eslint/eslint-plugin":"^8.0.1","@typescript-eslint-v5/eslint-plugin":"npm:@typescript-eslint/eslint-plugin@^5","@typescript-eslint-v6/eslint-plugin":"npm:@typescript-eslint/eslint-plugin@^6","@typescript-eslint-v7/eslint-plugin":"npm:@typescript-eslint/eslint-plugin@^7"},"peerDependencies":{"eslint":"^9.0.0 || ^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0"},"peerDependenciesMeta":{"@typescript-eslint/eslint-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-unused-imports_4.1.2_1723140999435_0.36147861845146223","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":1723140999605,"_cnpm_publish_time":1723140999605,"dist-tags":{"latest":"4.4.1"}}