File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ async function getMarkdownRecommendedConfig() {
2828 name : "markdown/code-blocks/js" ,
2929 files : [ "**/*.md/*.js" ] ,
3030 languageOptions : {
31+ sourceType : "module" ,
3132 parserOptions : {
3233 ecmaFeatures : {
34+ globalReturn : true ,
3335 impliedStrict : true ,
3436 } ,
3537 } ,
Original file line number Diff line number Diff line change 1+ # Test
2+
3+ ``` js
4+ const path = require (" node:path" );
5+
6+ console .log (path .resolve (__dirname , " ./test" ));
7+
8+ function run () {
9+ console .log (" RUN" );
10+ }
11+
12+ run ();
13+ ```
14+
15+ ``` js
16+ import { fileURLToPath } from " node:url" ;
17+ import { dirname } from " node:path" ;
18+
19+ const __filename = fileURLToPath (import .meta.url);
20+
21+ console .log (path .resolve (__dirname , " ./test" ));
22+
23+ function run () {
24+ console .log (" RUN" );
25+ }
26+
27+ run ();
28+ ` ` `
You can’t perform that action at this time.
0 commit comments