Skip to content

Commit 2d28261

Browse files
committed
test(snap): cover root-workspace fallback in nested-oxc-config-proj-1
Add root-cwd cases that must fail under the root config's strict rules, complementing the existing proj-1 cwd cases that pass under the nested override.
1 parent b17614e commit 2d28261

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

packages/cli/snap-tests/nested-oxc-config-proj-1/snap.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,27 @@ Finished in <variable>ms on 2 files with <variable> rules using <variable> threa
1212
Checking formatting...
1313
All matched files use the correct format.
1414
Finished in <variable>ms on 1 files using <variable> threads.
15+
16+
> # Running from the workspace root must use the root config, so both
17+
> # commands should fail: lint flags the `debugger;` and fmt flags the
18+
> # double-quoted string in packages/proj-1/src/index.js.
19+
[1]> vp lint
20+
21+
× eslint(no-debugger): `debugger` statement is not allowed
22+
╭─[packages/proj-1/src/index.js:2:3]
23+
1 │ function hello() {
24+
2 │ debugger;
25+
· ─────────
26+
3 │ return "hello from proj-1";
27+
╰────
28+
help: Remove the debugger statement
29+
30+
Found 0 warnings and 1 error.
31+
Finished in <variable>ms on 3 files with <variable> rules using <variable> threads.
32+
33+
[1]> vp fmt --check packages/proj-1/src
34+
Checking formatting...
35+
packages/proj-1/src/index.js (<variable>ms)
36+
37+
Format issues found in above 1 files. Run without `--check` to fix.
38+
Finished in <variable>ms on 1 files using <variable> threads.

packages/cli/snap-tests/nested-oxc-config-proj-1/steps.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"# root config leaks through, lint reports a debugger violation and fmt",
99
"# reports a quote-style diff.",
1010
"cd packages/proj-1 && vp lint",
11-
"cd packages/proj-1 && vp fmt --check src"
11+
"cd packages/proj-1 && vp fmt --check src",
12+
"# Running from the workspace root must use the root config, so both",
13+
"# commands should fail: lint flags the `debugger;` and fmt flags the",
14+
"# double-quoted string in packages/proj-1/src/index.js.",
15+
"vp lint",
16+
"vp fmt --check packages/proj-1/src"
1217
]
1318
}

0 commit comments

Comments
 (0)