{"name":"eslint-plugin-unused-imports","version":"4.1.0","keywords":["eslint","eslintplugin","eslint-plugin","import","unused","modules","autofix"],"author":{"name":"Mikkel Holmer Pedersen"},"license":"MIT","_id":"eslint-plugin-unused-imports@4.1.0","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":"8448459d764ebfe113ff7ad7bb42acbcc35f153f","tarball":"http://registry-npm.ywwl.com/eslint-plugin-unused-imports/download/eslint-plugin-unused-imports-4.1.0.tgz","fileCount":7,"integrity":"sha512-js5zqzxhM3US4RVICde5nwqEdppI660ZRYFp8WipLLeTJANhA30DQAII2yRvnw369i3eKoOJ2VhMvWz5wzY+Ow==","signatures":[{"sig":"MEUCIGdZBF87XmGv2a3I7D7H0oAFiyOfKMPR9TbYG4dn4ty8AiEAh1WSCHa7XRpkKxiuqD+Py1TMhcuJtePNwPkD8NrdrkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15373,"size":4171,"noattachment":false,"key":"/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.0.tgz"},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"1f63a3f5c6f3c18ab46ca2fe314a66f5e6c1510e","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.0_1723138356967_0.2617593071200517","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":1723138357175,"_cnpm_publish_time":1723138357175,"dist-tags":{"latest":"4.4.1"}}