Skip to content

Conversation

@ArnaudBarre
Copy link

@ArnaudBarre ArnaudBarre commented Nov 2, 2025

Description

In a TypeScript codebase, it's frequent to require multiple configuration files for a project. The convention is to use <prefix>.tsconfig.json like test.tsconfig.json or node.tsconfig.json.

Checklist:

@ArnaudBarre ArnaudBarre requested a review from a team as a code owner November 2, 2025 14:56
@DecimalTurn
Copy link
Contributor

DecimalTurn commented Nov 3, 2025

The tests are failing because the filename of the sample you submitted is of the form: tsconfig.<suffix>.json instead of the extension .tsconfig.json.

If the goal of your PR was simply to support this file extension, I guess you can simply replace with another sample from the search results in your original post.

Unfortunately Linguist doesn't support wildcards, so we can't have .tsconfig.*.json as an extension. We would need to add every possible tsconfig extension types to add support to them assuming they meet the popularity threshold.

However, looking at search results for files using a file extension of the form .tsconfig.*.json, there's only a few results. This tells me it would be better to target direct filenames such as the ones seen here:

  • tsconfig.app.json
  • tsconfig.build.json
  • tsconfig.editor.json
  • tsconfig.spec.json
  • etc.

EDIT: Fixed some errors in original message

@ArnaudBarre
Copy link
Author

ArnaudBarre commented Nov 4, 2025

Thanks for looking into it and sorry for doing this too quickly and not seing that it's actually way more common to do tsconfig.*.json than *.tsconfig.json and that's what the Vite templates are using 🙈

I don't think listing tsconfig.app.json, tsconfig.build.json, ... is a good direction because it will be more maintenance to decide what is going in the list or not. Instead I think it's better to push for a unique .tsconfig.json extension and spread the word that naming it this way get's you better syntax highlighting. I will update the Vite template accordingly and try to spread the word.

@DecimalTurn
Copy link
Contributor

DecimalTurn commented Nov 4, 2025

Instead I think it's better to push for a unique .tsconfig.json extension and spread the word that naming it this way get's you better syntax highlighting.

It would be much simpler indeed, but if there's enough people that use those filenames like tsconfig.app.json, I don't see a reason not to support it. That can be done seperatly from this PR however.

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