Skip to content

Conversation

@dummdidumm
Copy link
Member

Not any tsconfig over a closer jsconfig. This aligns with TS VS Code behavior.

@jasonlyu123 could you double-check if that's the correct behavior?

Not any tsconfig over a closer jsconfig. This aligns with TS VS Code behavior
@jasonlyu123
Copy link
Member

Yeah, it should be the same behaviour as the VSCode/tsserver.

They didn't use findConfigFile, though. But a specialized method for the tsserver with some optimization. The loading logic is here. You can check if there are any differences.
https://github.com/microsoft/TypeScript/blob/2a8436c529640327a3460463fc945694584ff1c3/src/server/editorServices.ts#L2090

It starts from the directory where the file is and walks up the directory tree. If there is any tsconfig or jsconfig, return it.

On a side note, We could also consider caching the result like tsserver in the future. But since the file-exists check is usually fast, it probably won't make a huge difference.

@dummdidumm
Copy link
Member Author

Thanks for the check! I kept the more simple version we have now but added an additional node_modules check (like they do) and added the caching - I think it's a good thing to make, much less IO operations then.

@dummdidumm dummdidumm merged commit 7e62a29 into sveltejs:master Feb 16, 2023
@dummdidumm dummdidumm deleted the fix-config-lookup branch February 16, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants