organize-imports-cli
v1.0.2
Published
VS Code's 'Organize imports' executable from command line
Readme
organize-imports-cli
VS Code's 'Organize imports' executable from command line
Plays nicely with Prettier and lint-staged:
"lint-staged": {
"*.ts": [
"organize-imports-cli",
"prettier --write"
]
}Usage
> organize-imports-cli [--list-different] paths...Each path is one of:
- a
ts/jsfile (and related extensions:.tsx,.mts,.cts,.jsx,.mjs,.cjs) - a
tsconfig*.json— the whole project is processed - a directory — walked recursively for the extensions above
- a glob pattern — e.g.
'src/**/*.ts'(quote it so the shell doesn't expand it)
Directory walks and glob patterns skip node_modules.
Files containing the substring // organize-imports-ignore are skipped.
The --list-different flag prints a list of files with unorganized imports. No files are modified.
Requirements
Node.js ≥ 22.12.
