Skip to content

Commit 3dc07ba

Browse files
committed
test(snap): cover root-cwd lint in workspace-lint-subpackage
Root config's `no-console: warn` should flag app-a's console.log when vp lint runs from the workspace root, complementing the existing nested-override case where the sub-workspace's `no-console: off` wins.
1 parent 36f0a05 commit 3dc07ba

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
> cd packages/app-a && vp lint # sub-workspace has no-console:off but root has no-console:warn
22
Found 0 warnings and 0 errors.
33
Finished in <variable>ms on 2 files with <variable> rules using <variable> threads.
4+
5+
> vp lint # at root, no-console:warn should flag app-a's console.log
6+
7+
⚠ eslint(no-console): Unexpected console statement.
8+
╭─[packages/app-a/src/index.js:2:3]
9+
1 │ function hello() {
10+
2 │ console.log('hello from app-a');
11+
· ───────────
12+
3 │ return 'hello';
13+
╰────
14+
help: Delete this console statement.
15+
16+
Found 1 warning and 0 errors.
17+
Finished in <variable>ms on 3 files with <variable> rules using <variable> threads.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"ignoredPlatforms": ["win32"],
33
"commands": [
4-
"cd packages/app-a && vp lint # sub-workspace has no-console:off but root has no-console:warn"
4+
"cd packages/app-a && vp lint # sub-workspace has no-console:off but root has no-console:warn",
5+
"vp lint # at root, no-console:warn should flag app-a's console.log"
56
]
67
}

0 commit comments

Comments
 (0)