File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -44,3 +44,36 @@ According to their [debugging guide](https://github.com/microsoft/TypeScript/blo
44
44
- while debugging, tsc will evaluate global ` .d.ts ` files before the targeted test file
45
45
- ` Debug.formatXXX(value) ` from ` src/compiler/debug.ts ` can be used to print out enum values
46
46
- use the "WATCH" section to "see" value of interest
47
+
48
+ ## Debug Linter in VSCode
49
+
50
+ It's easy to debug Linter for a npm project somewhere else with [ CodeLLDB] ( https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb ) .
51
+
52
+ In ` .vscode/launch.json ` , change config fields to your need:
53
+
54
+ - ` cwd ` : absolute path to the npm project
55
+ - ` args ` : arguments passed to linter
56
+
57
+ ``` json
58
+ {
59
+ "type" : " lldb" ,
60
+ "request" : " launch" ,
61
+ "name" : " Debug Oxlint" ,
62
+ "cargo" : {
63
+ "env" : {
64
+ "RUSTFLAGS" : " -g"
65
+ },
66
+ "args" : [" build" , " --bin=oxlint" , " --package=oxlint" ],
67
+ "filter" : {
68
+ "name" : " oxlint" ,
69
+ "kind" : " bin"
70
+ }
71
+ },
72
+ "cwd" : " PATH-TO-TEST-PROJECT" , // [!code focus]
73
+ "args" : [" --ARGS-TO-OXLINT" ] // [!code focus]
74
+ }
75
+ ```
76
+
77
+ Open VS Code Debugging panel and select ` Debug Oxlint ` , then start debugging.
78
+
79
+ The debug process will be launched with specified ` cwd ` , like running linter in testing project and attaching debugger into it.
You can’t perform that action at this time.
0 commit comments