Skip to content

Commit 404c7c8

Browse files
fix: use dirty parser configuration for markdown (#46)
1 parent 48ffee2 commit 404c7c8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

configs/markdown.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
},

validation/file.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
```

0 commit comments

Comments
 (0)