Skip to content

Commit f2f9dab

Browse files
committed
test: assert lint-vite-plus-imports fails before fix
1 parent 7eceea6 commit f2f9dab

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

packages/cli/snap-tests/lint-vite-plus-imports/snap.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
[1]> vp lint src/index.ts src/types.ts # should fail before fix
2+
3+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus' instead of 'vite' in Vite+ projects.
4+
╭─[src/index.ts:1:30]
5+
1 │ import { defineConfig } from 'vite';
6+
· ──────
7+
2 │
8+
╰────
9+
10+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus' instead of 'vitest/config' in Vite+ projects.
11+
╭─[src/index.ts:3:30]
12+
2 │
13+
3 │ const configPromise = import('vitest/config');
14+
· ───────────────
15+
4 │
16+
╰────
17+
18+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus/test' instead of 'vitest' in Vite+ projects.
19+
╭─[src/index.ts:5:24]
20+
4 │
21+
5 │ export { expect } from 'vitest';
22+
· ────────
23+
6 │
24+
╰────
25+
26+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus/test' instead of 'vitest' in Vite+ projects.
27+
╭─[src/types.ts:1:30]
28+
1 │ type TestFn = (typeof import('vitest'))['test'];
29+
· ────────
30+
2 │
31+
╰────
32+
33+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus/test/browser-playwright' instead of '@vitest/browser-playwright' in Vite+ projects.
34+
╭─[src/types.ts:3:16]
35+
2 │
36+
3 │ declare module '@vitest/browser-playwright' {}
37+
· ────────────────────────────
38+
4 │
39+
╰────
40+
41+
× vite-plus(prefer-vite-plus-imports): Use 'vite-plus/client' instead of 'vite/client' in Vite+ projects.
42+
╭─[src/types.ts:5:25]
43+
4 │
44+
5 │ import client = require('vite/client');
45+
· ─────────────
46+
6 │
47+
╰────
48+
49+
Found 0 warnings and 6 errors.
50+
Finished in <variable>ms on 2 files with <variable> rules using <variable> threads.
51+
152
> vp lint --fix src/index.ts src/types.ts # rewrite vite and vitest imports via the vite-plus oxlint plugin
253
Found 0 warnings and 0 errors.
354
Finished in <variable>ms on 2 files with <variable> rules using <variable> threads.

packages/cli/snap-tests/lint-vite-plus-imports/steps.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"commands": [
3+
"vp lint src/index.ts src/types.ts # should fail before fix",
34
"vp lint --fix src/index.ts src/types.ts # rewrite vite and vitest imports via the vite-plus oxlint plugin",
45
"cat src/index.ts",
56
"cat src/types.ts",

0 commit comments

Comments
 (0)