Skip to content

Commit 210032d

Browse files
committed
chore: fix linting errors
1 parent 8b972ce commit 210032d

File tree

4 files changed

+30
-34
lines changed

4 files changed

+30
-34
lines changed

index.ts

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
import { convertPreset } from '@visbot/webvsc';
2-
import { basename, extname } from 'node:path';
31
import { stat } from 'node:fs/promises';
2+
import { basename, extname } from 'node:path';
3+
import { convertPreset } from '@visbot/webvsc';
44

55
export default function ViteAvsPlugin() {
6-
return {
7-
name: 'avs',
8-
async transform(code: string, id: string) {
9-
if (!/\.avs$/.test(id) && !/\.wvs$/.test(id)) {
10-
return;
11-
}
6+
return {
7+
name: 'avs',
8+
async transform(code: string, id: string) {
9+
if (!/\.avs$/.test(id) && !/\.wvs$/.test(id)) {
10+
return;
11+
}
1212

13-
const textEncoder = new TextEncoder();
13+
const textEncoder = new TextEncoder();
1414

15-
const input = textEncoder.encode(code)
16-
const ext = extname(id);
17-
const name = basename(id, ext);
18-
const date = (await stat(id)).mtime || new Date();
15+
const input = textEncoder.encode(code);
16+
const ext = extname(id);
17+
const name = basename(id, ext);
18+
const date = (await stat(id)).mtime || new Date();
1919

20-
const output = convertPreset(input, name, date);
20+
const output = convertPreset(input, name, date);
2121

22-
return {
23-
code: [
24-
`const data = ${JSON.stringify(output)};`,
25-
'export default data;'
26-
].join('')
27-
};
28-
}
29-
}
22+
return {
23+
code: [`const data = ${JSON.stringify(output)};`, 'export default data;'].join(''),
24+
};
25+
},
26+
};
3027
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"scripts": {
2323
"build": "tsup",
2424
"dev": "npm run build -- --watch",
25+
"lint": "biome check --config-path=biome.jsonc --no-errors-on-unmatched --vcs-enabled=true --vcs-use-ignore-file=true",
2526
"prepack": "npm run build",
2627
"test": "cd tests && vite build"
2728
},

tests/vite.config.mjs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { defineConfig } from 'vite'
2-
import avs from '../dist/index.js'
1+
import { defineConfig } from 'vite';
2+
import avs from '../dist/index.js';
33

44
export default defineConfig({
5-
plugins: [
6-
avs()
7-
],
8-
build: {
9-
emptyOutDir: false,
10-
rollupOptions: {
11-
input: 'test.mjs'
12-
}
13-
}
5+
plugins: [avs()],
6+
build: {
7+
emptyOutDir: false,
8+
rollupOptions: {
9+
input: 'test.mjs',
10+
},
11+
},
1412
});

tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export default defineConfig({
77
format: 'esm',
88
minify: true,
99
platform: 'node',
10-
treeshake: 'recommended'
10+
treeshake: 'recommended',
1111
});

0 commit comments

Comments
 (0)