Skip to content

Commit 11e4980

Browse files
committed
test(snap): pin oxlint ignorePatterns + nested-config behavior
Documents two behaviors observed while investigating why `vp lint` at the repo root was leaking snap-test fixture diagnostics: 1. Root vite.config.ts `lint.ignorePatterns` (wildcard-prefixed) does filter files out of the lint walk when no nearer oxlint config exists — packages/ignored/src/index.js is skipped despite its console.log. 2. Nested vite.config.ts in a subpackage (packages/included/ vite.config.ts, no-console:off) is NOT consulted when cwd is the workspace root; the root's no-console:error still flags it.
1 parent f772b6f commit 11e4980

File tree

10 files changed

+79
-0
lines changed

10 files changed

+79
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "workspace-lint-ignore-patterns-test",
3+
"version": "0.0.0",
4+
"workspaces": [
5+
"packages/*"
6+
],
7+
"type": "module",
8+
"packageManager": "pnpm@10.16.1"
9+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "ignored",
3+
"version": "0.0.0"
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function ignored() {
2+
console.log('this file matches root ignorePatterns');
3+
return 'ignored';
4+
}
5+
6+
export { ignored };
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "included",
3+
"version": "0.0.0"
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function included() {
2+
console.log('this file is not in ignorePatterns');
3+
return 'included';
4+
}
5+
6+
export { included };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
lint: {
3+
rules: {
4+
'no-console': 'off',
5+
},
6+
},
7+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- '.'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
> # Tests whether oxlint honors a `**/`-prefixed glob in root lint.ignorePatterns.
2+
> # Mirrors how the vp repo declares ignorePatterns: ['**/snap-tests/**'].
3+
[1]> vp lint
4+
5+
× eslint(no-console): Unexpected console statement.
6+
╭─[packages/included/src/index.js:2:3]
7+
1 │ function included() {
8+
2 │ console.log('this file is not in ignorePatterns');
9+
· ───────────
10+
3 │ return 'included';
11+
╰────
12+
help: Delete this console statement.
13+
14+
Found 0 warnings and 1 error.
15+
Finished in <variable>ms on 3 files with <variable> rules using <variable> threads.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"ignoredPlatforms": ["win32"],
3+
"commands": [
4+
"# Tests whether oxlint honors a `**/`-prefixed glob in root lint.ignorePatterns.",
5+
"# Mirrors how the vp repo declares ignorePatterns: ['**/snap-tests/**'].",
6+
"vp lint"
7+
]
8+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default {
2+
lint: {
3+
options: {
4+
typeAware: true,
5+
typeCheck: true,
6+
},
7+
plugins: ['unicorn', 'typescript', 'oxc'],
8+
categories: {
9+
correctness: 'error',
10+
perf: 'error',
11+
suspicious: 'error',
12+
},
13+
rules: {
14+
'no-console': 'error',
15+
},
16+
ignorePatterns: ['**/ignored/**'],
17+
},
18+
};

0 commit comments

Comments
 (0)