organize-imports-cli
organize-imports-cli copied to clipboard
Path-based file or directory exclusion
As far as I can tell, the only ways to exclude files/directories from being organized are
- Add
// organize-imports-ignore
to each file. - Exclude the files in your
tsconfig.json
- Specify every file except the ones you want to exclude
I use organize-imports-cli
in lint-staged
and I want to exclude a single folder because it has autogenerated code that I don't want to touch. Other linters make this dead simple, usually by adding a path to an "ignore" file or command line option. Is there something similar for organize-imports-cli
? Or interest in implementing it?
lint-staged is configured by globs. Why not use them to exclude the autogenerated files?
Because it's not really how lint-staged
is meant to work (see this part of their README) and figuring out the correct glob syntax is much trickier than say, adding the following to an .eslintignore
:
my/ignore/dir
Okay, PRs welcome