Skip to content

Mark tsconfig files as JSONC for linguist#3573

Open
sirreal wants to merge 2 commits into
WordPress:trunkfrom
sirreal:tsconfig-linguist-language-json-with-comments
Open

Mark tsconfig files as JSONC for linguist#3573
sirreal wants to merge 2 commits into
WordPress:trunkfrom
sirreal:tsconfig-linguist-language-json-with-comments

Conversation

@sirreal
Copy link
Copy Markdown
Member

@sirreal sirreal commented Apr 30, 2026

This will help GitHub's syntax highlighting to correctly display
comments in tsconfig files.

For example, note the "invalid" (red) syntax highlighting here:

"src/**/*.spec.ts",
"src/**/*.test.ts",
// Avoid generating types for this file during the build.
// The module is not included in bundled build output,
// so its type definition should be excluded as well.
"src/additional-remote-origins.ts"
]

This will help GitHub's syntax highlighting to correctly display
comments in tsconfig files.
@sirreal sirreal requested review from a team, Copilot and zaerl April 30, 2026 11:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Marks tsconfig*.json files as JSON-with-Comments for GitHub Linguist so GitHub renders comments correctly (no “invalid JSON” highlighting) in tsconfig files.

Changes:

  • Add a .gitattributes rule to classify tsconfig*.json as JSON-with-Comments for Linguist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .gitattributes Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sirreal sirreal requested a review from Copilot April 30, 2026 11:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Git attributes so GitHub Linguist treats tsconfig files as JSON-with-comments, improving syntax highlighting for commented tsconfig*.json files.

Changes:

  • Add Linguist language overrides for tsconfig.json and tsconfig.*.json via .gitattributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .gitattributes
Comment on lines +2 to +3
tsconfig.json linguist-language=JSON-with-Comments
tsconfig.*.json linguist-language=JSON-with-Comments
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the language name is already correct with the -.

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