-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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 .cjs to known JavaScript file extensions #85460
Conversation
@@ -957,7 +957,7 @@ | |||
] | |||
}, | |||
"fenced_code_block_js": { | |||
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(js|jsx|javascript|es6|mjs|\\{\\.js.+?\\})((\\s+|:|\\{)[^`~]*)?$)", | |||
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(js|jsx|javascript|es6|mjs|cjs|\\{\\.js.+?\\})((\\s+|:|\\{)[^`~]*)?$)", |
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.
Note that this grammar is generated from https://github.com/microsoft/vscode-markdown-tm-grammar
Make sure this is also updated upstream or else this change will be overwritten when we pull in the next update to this grammar
@@ -33,7 +33,7 @@ function patchGrammar(grammar) { | |||
|
|||
function adaptToJavaScript(grammar, replacementScope) { | |||
grammar.name = 'JavaScript (with React support)'; | |||
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs']; | |||
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs', '.cjs']; |
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.
Make sure to re-build the grammar after changing the build script:
cd extensions/typescript-basics
npm run update-grammars
Can you please create an issue for this as well. This helps us track what is delivered each milestone |
Thanks! |
Add
.cjs
to known JavaScript file extensions.Related:
--experimental-modules
. https://github.com/nodejs/node/releases/tag/v13.2.0