Skip to content

Commit 04638b9

Browse files
committed
test: add snap test to verify vp lint skips plugin loading
1 parent b84492a commit 04638b9

5 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "vite-plugins-skip-on-lint-test",
3+
"private": true
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> # Test that vp lint does not load plugins (the plugin throws if loaded)
2+
> vp lint src/
3+
Found 0 warnings and 0 errors.
4+
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const foo = 'bar';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commands": [
3+
"# Test that vp lint does not load plugins (the plugin throws if loaded)",
4+
"vp lint src/"
5+
]
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig, vitePlugins } from 'vite-plus';
2+
3+
export default defineConfig({
4+
plugins: [
5+
vitePlugins(() => {
6+
throw new Error('Plugins should not be loaded during lint');
7+
}),
8+
],
9+
});

0 commit comments

Comments
 (0)