Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple, root-level tsconfigs #51382

Closed
kylemh opened this issue Oct 11, 2022 · 3 comments
Closed

Support for multiple, root-level tsconfigs #51382

kylemh opened this issue Oct 11, 2022 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@kylemh
Copy link

kylemh commented Oct 11, 2022

#48189 and #35395 (comment) are really nice new additions, but ones that are incredibly limited by my inability to have VS Code be aware of the fact that some files are using a different TS Config.

Sure, I could use different TS Configs in different folders so findup resolves rules correctly; however, that's not always ideal!Imagine a typical components folder full of folders that house component source code, test files, and maybe Storybook files...

component
        ├── __tests__
        |       └ component.test.tsx
        ├── __stories__
        |       └ component.stories.tsx
        └── component.tsx

Different file suffixes and different contexts ripe for developer experience improvements; however, to actually provide different tsconfig contexts to these files, I'd need:

component
        ├── __tests__
        |       ├ tsconifg.test.json
        |       └ component.test.tsx
        ├── __stories__
        |       ├ tsconifg.stories.json
        |       └ component.stories.tsx
        └── component.tsx

This is untenable. Instead, I wanted to suggest the ability to map multiple TS Configs to VS Code where in-project collisions are checked for (so no 2 tsconfigs read the same file). If there are no collisions, VS Code will choose the correct tsconfig regarding the file in view. If there are collisions, then warn that VS Code isn't certain about which tsconfig.json to use and try to fail the compiler at top-of-file.

@sceurty
Copy link

sceurty commented Oct 28, 2022

My team has the same issue.
We try to co-locate our UI tests with our product code, and each set has its own tsconfig file which cannot be shared.
I added the jest-expect-message library to be used by our tests but Visual Studio Code keeps showing a type error, even though our external TypeScript type check succeeds.
After looking at the content of tsserver.log, I can tell Visual Studio Code is using the wrong tsconfig for the test.

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 2, 2022
@mjbvz mjbvz removed their assignment Nov 2, 2022
@mjbvz
Copy link
Contributor

mjbvz commented Nov 2, 2022

Related #33094

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Dec 7, 2022
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants