Skip to content

Clarify error when content mapper extension ends in a built-in extension - #64921

Open
GOVARDHAN CHINTA (govardhanchinta99) wants to merge 2 commits into
microsoft:mainfrom
govardhanchinta99:fix-64917-content-mapper-message
Open

GOVARDHAN CHINTA (govardhanchinta99) wants to merge 2 commits into
microsoft:mainfrom
govardhanchinta99:fix-64917-content-mapper-message

Conversation

@govardhanchinta99

@govardhanchinta99 GOVARDHAN CHINTA (govardhanchinta99) commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #64917

A content mapper extension is rejected when it ends in a built-in extension (HasReservedSourceExtension does a suffix check). For .const.json the error said it "is a built-in extension", which is misleading, because .const.json is not built-in, it is rejected because it ends in .json.

This changes the message for TS18066 to: "Content mapper file extension '{0}' cannot be registered because it ends in a built-in extension." The error code and the check itself are unchanged. I did not add support for .const.json-style extensions, since that looks like a design decision for the team.

Changes:

  • Reworded the message in diagnosticMessages.json
  • Regenerated the dependent files with npx hereby generate:diagnostics
  • Updated the renamed diagnostic variable in tsconfigparsing.go and its tests

Testing: the tsoptions package and the compiler test runner (internal/testrunner) pass, and hereby check:format is clean.

cc Andrew Branch (@andrewbranch), you worked on content mappers, so I'd appreciate your view on whether this wording works.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 11:21
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 22, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@govardhanchinta99

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think the .json.gz files are supposed to be updated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for catching that. I removed all of the loc/*.json.gz changes in the latest commit, they are back to what main has. The PR now only touches the diagnostic message, the generated Go and JSON files for it, and the tsoptions code and tests.

The loc/*.json.gz files are produced by the localization pipeline and should not be updated in this PR. Restore them to the versions on main.

This branch has not been deployed

No deployments
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: Not started

Development

Successfully merging this pull request may close these issues.

"Content mapper file extension '.const.json' is a built-in extension and cannot be registered by a content mapper." error is misleading

3 participants