Skip to content

Commit 6221add

Browse files
committed
enable debug support
1 parent 21732a1 commit 6221add

File tree

8 files changed

+233
-2
lines changed

8 files changed

+233
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ dist/
33
sample_cases/
44
wasm-toolchain
55
coverage
6-
.vscode
76
reference

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"args": ["--no-timeouts", "--colors", "--inspect-brk", "tests/rules/playground.ts"],
9+
"runtimeArgs": [
10+
"--experimental-specifier-resolution=node",
11+
"--experimental-loader",
12+
"ts-node/esm",
13+
"--experimental-loader",
14+
"./loader.mjs",
15+
"--no-warnings"
16+
],
17+
"internalConsoleOptions": "openOnSessionStart",
18+
"name": "Mocha Tests",
19+
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
20+
"request": "launch",
21+
"skipFiles": [
22+
"${workspaceFolder}/node_modules/**/*.js",
23+
"<node_internals>/**"
24+
],
25+
"type": "node"
26+
}
27+
]
28+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mochaExplorer.files": "dist/tests/**/*.test.js",
3+
}

loader.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
let is_main = true;
2+
3+
export const load = (url, context, loadNext) => {
4+
if (is_main) {
5+
is_main = false;
6+
7+
if (!context.format) {
8+
context.format = "commonjs";
9+
}
10+
}
11+
12+
return loadNext(url, context, loadNext);
13+
};

package-lock.json

Lines changed: 158 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"mocha": "^11.2.2",
5757
"npm-run-all": "^4.1.5",
5858
"prettier": "^3.5.3",
59+
"ts-node": "^10.9.2",
5960
"tsx": "^4.19.3"
6061
},
6162
"dependencies": {

tests/rules/playground.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { describe, it } from "mocha";
2+
import { createRuleTester } from "../utils/testUtils.js";
3+
import noRepeatedMemberAccess from "../../plugins/rules/memberAccess.js";
4+
5+
describe("Rule: no-spread", () => {
6+
const ruleTester = createRuleTester();
7+
8+
it("validates all test cases for no-repeated-member-access rule", () => {
9+
ruleTester.run("no-repeated-member-access", noRepeatedMemberAccess, {
10+
valid: [
11+
`
12+
const x=a.b.c;
13+
`,
14+
],
15+
16+
invalid: [],
17+
});
18+
});
19+
});

todo.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
a.b.c.d.e 从e开始往上遍历,看看触发了多少次
2+
明确AST和node的遍历过程
3+
4+
考虑用树来存储
5+
6+
从输入到输出,对数据做加工,考虑用什么数据结构合适
7+
8+
明确库函数的作用
9+
10+
例子:
11+
get().a.b

0 commit comments

Comments
 (0)