amatiasq / vsc-sort-imports

Sort ES6 imports automatically.
ISC License
58 stars 24 forks source link

Import sort fails with syntax error. Fails to load babel config. #40

Closed Alxandr closed 5 years ago

Alxandr commented 5 years ago

I get a syntax error when trying to sort typescript, even though it works from the import-sort CLI. Debugging into the extension I think the issue originates from import-sort itself, and the fact that CWD is "wrong" in VS Code. I created issue https://github.com/renke/import-sort/issues/84 over in the import-sort repo. This issue here is in case others arrive at the same issue, and to track progress of the upstream issue, as minor changes to the extension (maybe just updating deps) might need to be done once it's resolved.

amatiasq commented 5 years ago

Thanks! Will keep it in track

jquense commented 5 years ago

@Alxandr do you know what cwd get's used by vscode? In practice i think the right value is likely the workspace root, if it's too close to the file in question babel still won't find the babelrc since as a default it starts at the file and looks up until it finds a package.json

Alxandr commented 5 years ago

I don't know. It's been too long since I looked at this, and I'm not working on the same project anymore, so I'm not sure I can figure out what it was doing either.

amatiasq commented 5 years ago

Unable to reproduce