Skip to content

Commit 8b9f7d4

Browse files
committed
test(check): verify real lint errors are not swallowed by suppress_unmatched
Add snap test that runs `vp check --fix` with paths (activating suppress_unmatched) on a file with a real lint error, confirming the error is still surfaced and the command exits non-zero.
1 parent bbb9ff7 commit 8b9f7d4

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-eval": "error"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "check-fix-lint-error-not-swallowed",
3+
"version": "0.0.0",
4+
"private": true
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[1]> vp check --fix src/index.js # real lint error with --fix and paths (suppress_unmatched active), error must not be swallowed
2+
error: Lint issues found
3+
× eslint(no-eval): eval can be harmful.
4+
╭─[src/index.js:2:3]
5+
1 │ function hello() {
6+
2 │ eval("code");
7+
· ────
8+
3 │ return "hello";
9+
╰────
10+
help: Avoid eval(). For JSON parsing use JSON.parse(); for dynamic property access use bracket notation (obj[key]); for other cases refactor to avoid evaluating strings as code.
11+
12+
Found 1 error and 0 warnings in 1 file (<variable>ms, <variable> threads)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function hello() {
2+
eval("code");
3+
return "hello";
4+
}
5+
6+
export { hello };
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"commands": [
3+
"vp check --fix src/index.js # real lint error with --fix and paths (suppress_unmatched active), error must not be swallowed"
4+
]
5+
}

0 commit comments

Comments
 (0)