-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 type checking .cjs
files
#38784
Comments
If some one does want to test #39840 https://github.com/stealify/typescript npm i -g vscode-typescript@https://github.com/stealify/typescript
# Getting global path
npm root -g Hit f1 on keyboard open user settings and set "typescript.tsdk": "{your_global_npm_path}/vscode-typescript/typescript/lib" restart is not needed. |
I would like to use the |
Agreed, seems odd that this isn't supported (or even planned?) yet. |
For people coming to this thread, you can add |
Fixed in #45884 (TypeScript 4.5) |
Search Terms
Suggestion
Treat files with the
.cjs
file extension the same as the.js
file extension, but disallowing ES Module syntax within them.Use Cases
In packages with:
in
package.json
, Node loads all.js
files as ES modules.To load a file as a CommonJS module, one has to use the
.cjs
file extension.Examples
Checklist
My suggestion meets these guidelines:
Related Issues
The text was updated successfully, but these errors were encountered: