A Prettier plugin that automatically removes unused imports from JavaScript, TypeScript, and React files during formatting. Version 1.15.0 is the latest stable release, actively maintained with monthly updates. Key differentiators: configurable to ignore specific directories (ideal for monorepos), supports exclusion comments per file, handles namespace imports, aliases, and qualified usages, merges duplicate imports, and has extensive test coverage (>80%). Compared to similar plugins like `prettier-plugin-unused-imports`, this one offers more granular control over which folders to exclude.
npm install prettier-plugin-unused-imports-configurableVerified import paths — ran on the pinned version, not inferred.
Installs the plugin, configures .prettierrc to enable it and ignore a directory, then formats a TypeScript file to remove an unused import.
Review your TypeScript imports after upgrading. The new parser may detect usage differently.
Use 'ignoreDirectories' exactly as documented in .prettierrc.
Place the comment on its own line above the first import statement in the file.
Ensure you have Prettier ^3.4.2 installed. If you encounter parsing errors, downgrade to <1.15.0.
Use 'ignoreDirectories' (without 'd' in 'ignore') in .prettierrc.
Upgrade prettier to ^3.4.2. If issues persist, downgrade to 1.14.0 or file an issue on GitHub.
Check the comment spelling and ensure it appears on its own line above the first import.