Skip to content

Support overriding the types of a set of JSON files #50095

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

Closed
wants to merge 1 commit into from

Conversation

Zzzen
Copy link
Contributor

@Zzzen Zzzen commented Jul 29, 2022

Fixes #49703

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jul 29, 2022
"File '/hello.locstring.json.ts' does not exist.",
"File '/hello.locstring.json.tsx' does not exist.",
"File '/hello.locstring.json.d.ts' exist - use it as a name resolution result.",
"======== Module name './hello.locstring.json' was successfully resolved to '/hello.locstring.json.d.ts'. ========"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would the same be true for .d.ts contained in node_modules? would .d.ts from node_modules "win" over the local override?

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so ambient module declarations for relative imports are.... weird, and I don't really like them, since we don't do anything like that today. I thought in the original issue the problem was with non-relative imports, but no - you can use ambient modules for those. Moreover, we now support .d.json.ts files that you can drop alongside the .json to override their type - this has to be done file-by-file, rather than a pattern; but I don't think that's a massive loss. Given that, I'm going to close this. Thanks!

@weswigham weswigham closed this Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support overriding the types of a set of JSON files
4 participants