Skip to content
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

Add mts and cts TypeScript extensions #5905

Merged
merged 9 commits into from
Jun 7, 2022

Conversation

nicolo-ribaudo
Copy link
Contributor

@nicolo-ribaudo nicolo-ribaudo commented May 22, 2022

Description

TypeScript 4.7 introduced two new extensions: .mts and .cts - https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#new-file-extensions
They are already widely used on GitHub, because they were initially announced for TypeScript 4.5 a few months ago.

Checklist:

@nicolo-ribaudo nicolo-ribaudo requested a review from a team as a code owner May 22, 2022 19:00
Copy link

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Please don't rename an existing sample. Please add another sample with the new extension instead. These samples are used to train the classifier for that particular extension so "removing" by renaming could affect the results.

Copy link
Collaborator

@Alhadis Alhadis left a comment

Choose a reason for hiding this comment

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

@nicolo-ribaudo To elaborate on @lildude's feedback, we'll two new samples, one for .cts and another for .mts. I recommend finding a genuine example instead of copy+pasting the contents of promisified_cp.cts as promisified_cp.mts.

So to recap, the contents of samples/TypeScript should contain:

 samples/TypeScript/cache.ts
+samples/TypeScript/promisified_cp.cts
+samples/TypeScript/{SOMETHING_NEW}.mts

@nicolo-ribaudo
Copy link
Contributor Author

Examples updated!

@Josh-Cena
Copy link

Josh-Cena commented May 28, 2022

Suggestion: I think we can showcase some .mts/.cts-only features—for example, import.meta can only be used in .mts files, and export = can only be used in .cts files

@lildude lildude linked an issue Jun 1, 2022 that may be closed by this pull request
@lildude
Copy link
Member

lildude commented Jun 1, 2022

I plan to make a new release next week. It'll be great if we can get mts and cts specific samples as they're used to train the classifier so the more representative the samples, the better the classifier.

@nicolo-ribaudo
Copy link
Contributor Author

Done!

@lildude lildude merged commit a665b5f into github-linguist:master Jun 7, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the typescript-mts-cts branch June 7, 2022 09:24
sharkdp pushed a commit to kidonng/bat that referenced this pull request Sep 4, 2022
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MTS TypeScript files
5 participants