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

Support MTS TypeScript files #5696

Closed
rorymalcolm opened this issue Dec 20, 2021 · 6 comments · Fixed by #5905
Closed

Support MTS TypeScript files #5696

rorymalcolm opened this issue Dec 20, 2021 · 6 comments · Fixed by #5905

Comments

@rorymalcolm
Copy link

rorymalcolm commented Dec 20, 2021

Describe the enhancement

As of TypeScript 4.5, TypeScript supports .mts and .cts files as possible extensions. Linguist should recognise these files as TypeScript files and highlight / index them accordingly.

rorymalcolm added a commit to rorymalcolm/linguist that referenced this issue Dec 20, 2021
Fixes: github-linguist#5696

Linguist should support the new extensions added in TypeScript 4.5 `.mts` (for es modules) and `.cts` (for commonjs).

Linguist already supports `.mjs` files, the JavaScript equivalent.
@lildude
Copy link
Member

lildude commented Dec 21, 2021

I suspect you didn't plan on closing this so I'm reopening. I also think you mean .cts and not .mcs.

Please note, support won't be added, ie any PR adding support won't be merged, until there is widespread use of the extensions (see CONTRIBUTING.md).

@lildude lildude reopened this Dec 21, 2021
@rorymalcolm
Copy link
Author

I suspect you didn't plan on closing this so I'm reopening. I also think you mean .cts and not .mcs.

Please note, support won't be added, ie any PR adding support won't be merged, until there is widespread use of the extensions (see CONTRIBUTING.md).

Hi, I did mean to close, although it's in wide use on GitHub (mostly within node_modules folders), official support has been delayed and therefore I didn't want to commit to it.

Alhadis added a commit to file-icons/atom that referenced this issue Dec 28, 2021
Added:
* Config, Python: `.flake8`       (github-linguist/linguist#5669)
* C++:            `.ixx`          (github-linguist/linguist#5680)
* Database:       `MANIFEST.MF`   (github-linguist/linguist#5505)
* Docker:         `Containerfile` (github-linguist/linguist#5588)
* GLSL:           `.r{chit,miss}` (github-linguist/linguist#5566)
* HTML:           `.hta`          (github-linguist/linguist#5533)
* Makefile:       `.makefile`     (github-linguist/linguist#5526)
* Readme:         `CITATION.cff`  (github-linguist/linguist#5577)
* Shell:          `.kshrc`        (github-linguist/linguist#5685)
* TypeScript:     `.cts`, `.mts`  (github-linguist/linguist#5696)
* XML:            `.hzp`          (github-linguist/linguist#5626)
@Nixinova
Copy link
Contributor

Nixinova commented Feb 2, 2022

MTS is used in 2K+ repos even when I restrict search to just node_modules/*/index.d.mts, so that should be alright at least. (link)

@rorymalcolm
Copy link
Author

MTS is used in 2K+ repos even when I restrict search to just node_modules/*/index.d.mts, so that should be alright at least. (link)

Yeah althought it has widespread usage and semi support it's still the case that its not official yet, was meant to be in TS 4.6 but has since potentially slipped, see: microsoft/TypeScript#46452 for further info

@Inkdpixels
Copy link

Inkdpixels commented Apr 20, 2022

@rorymalcolm Not sure if it really slipped, the issue you are referencing states that this is the standard that they are aiming to establish, no?

Also the .mts / . cts extensions are announced in the 4.7 beta blog post

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#new-file-extensions

@rorymalcolm
Copy link
Author

@rorymalcolm Not sure if it really slipped, the issue you are referencing states that this is the standard that they are aiming to establish, no?

Also the .mts / . cts extensions are announced in the 4.7 beta blog post

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#new-file-extensions

Hadn't seen their inclusion 4.7's beta, probably fine, I just was aware there was some debate over it in the community when I wrote that comment months ago!

@lildude lildude linked a pull request Jun 1, 2022 that will close this issue
4 tasks
@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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants