Open mrseanryan opened 5 years ago
I will try to repro, with a codebase that I can share.
I wrote another import sorter for the exact same reason.
The TS Import Sorter supports both package.json
and import-sorter.json
and searches them all along the path till found. Please try it out if you think it's useful!
@daidodo - interesting. is that open source? If so, it could help to improve this project.
Yes, it's open-sourced. Feel free to use the code under src/config.
At that time I decided to start a new extension instead of modifying this one because there were other issues and open PRs (and they are still there).
Also I had a bunch of new features in mind apart from multi-root project support, e.g. recognising JSX element to keep React
import, deep understanding of unused imports instead of shallow identifier lookup, e.g.:
import { SomeEnum, UnusedId } from 'some/place'; // 'UnusedId' is actually unused
const x = SomeEnum.UnusedId; // 'UnusedId' is different from the imported name
A full list of features can be found HERE. Hope that helps you!
On a complex codebase, the feature which loads settings from 'import-sorter.json' does not work.
Unfortunately, I cannot reproduce the issue with a smaller codebase.
Details:
The file structure is like this (showing the workspace settings files only) src/.vscode/settings.json src/wm/itest/.vscode/settings.json src/wm/client/.vscode/settings.json src/wm/server/.vscode/settings.json src/mocks/.vscode/settings.json
Adding 'import-sorter.json' at root, does not work - the default 'factory' settings are used.
src/import-sorter.json
Have tried various other locations (adding matching setting to settings.json) example: src/.vscode/import-sorter.json