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
[New] TypeScript config: add .cts and .mts extensions #2851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
I'll rebase and land this once we get more travis-ci credits. |
AFAIK, |
@JounQin is that always? or only when verbatimModuleSyntax: true? |
@ljharb I don't think it's the same thing here. |
With TS transpiled to CJS, i would expect extensions to be looked up. |
No, the output extension will not change, although this feature is requested for a long time. TypeScript focuses on typings with correct module resolution, but never changes user's source codes. |
Gotcha. Does that mean this PR should be reverted? If it's not that straightforward, a PR to fix it would be appreciated. |
Yes, it must be reverted, I'll raise a PR tomorrow. Hope you can pin me with TypeScript related changes next time. 🩷 |
That's very reasonable; will do. |
This PR is pretty self explanatory.
.cts
and.mts
are common file extensions used in projects that are not fully CJS or not fully ESM.So I added those to the config.
I also fixed some of the grammar and made the comments wrap to 100 characters.