Skip to content

Conversation

@hnakrapunt
Copy link

@hnakrapunt hnakrapunt commented Dec 10, 2025

Fixes #32063

Summary

  • Enables type narrowing for JSON imports when using the const import attribute
  • Adds support for treating const JSON imports as literal types that can be narrowed

Test plan

  • Added conformance tests in tests/cases/conformance/importAttributes/importAttributesConstJson.ts
  • Added compiler test in tests/cases/compiler/jsonImportConstAttribute.ts

@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Dec 10, 2025
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 10, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@hnakrapunt hnakrapunt marked this pull request as draft December 10, 2025 14:55
@hnakrapunt
Copy link
Author

@microsoft-github-policy-service agree company="NVIDIA"

@hnakrapunt hnakrapunt closed this Dec 10, 2025
@github-project-automation github-project-automation bot moved this from Not started to Done in PR Backlog Dec 10, 2025
@hnakrapunt hnakrapunt deleted the hnakrapunt/narrowed-const-json-imports branch December 10, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

import ConstJson from './config.json' as const;

2 participants