A Prettier plugin (v0.0.7, no recent releases) that integrates import-sort into Prettier to automatically sort JavaScript and TypeScript import statements. It requires import-sort style modules like import-sort-style-module and is configured via package.json or config files. The plugin acts as a bridge, applying import-sort's sorting logic during Prettier formatting. It is unmaintained since 2020 and users are advised to migrate to alternatives like @trivago/prettier-plugin-sort-imports or eslint-plugin-import for active support.
npm install prettier-plugin-import-sortVerified import paths — ran on the pinned version, not inferred.
Shows setup and usage: install deps, configure importSort style and Prettier plugin, then format a file to sort imports.
Replace with @trivago/prettier-plugin-sort-imports or eslint-plugin-import.
Ensure extension list in importSort config is exactly '.js, .jsx, .ts, .tsx' (commas and spaces). Avoid patterns like '*.js'.
Install a style module (e.g., import-sort-style-module) and verify by running Prettier with --log-level debug.
Add 'parser': 'typescript' to importSort config if using TypeScript with decorators.
Use a Prettier v2-compatible version or switch to a maintained plugin.
Run: npm install -D import-sort-style-module
Upgrade Prettier to >= 2.0 or use prettier.resolveConfig.sync() method.
Check that 'importSort' key in package.json has correct structure with file extension mapping.
Ensure you are formatting a file with an appropriate extension (.js, .ts, etc.) or specify --parser.