Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
104 lines (101 loc) · 1.78 KB
/
Copy pathvite.config.ts
File metadata and controls
104 lines (101 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import globals from 'globals';
import { defineConfig } from 'vite-plus';
function mapGlobals(
vars: Record<string, boolean>,
): Record<string, 'readonly' | 'writable' | 'off'> {
return Object.fromEntries(
Object.entries(vars).map(([key, value]) => [key, value ? 'readonly' : 'off']),
);
}
const ignorePatterns = [
'.moon/cache/',
'.moon/docker/',
'.yarn/',
'packages/visualizer/*timestamp*',
'scripts/otel/data',
'target/',
'wasm/target/',
'**/.docusaurus/',
'**/coverage/',
'**/build/',
'**/cjs/',
'**/dist/',
'**/dts/',
'**/esm/',
'**/lib/',
'**/mjs/',
'**/node_modules/',
'**/umd/',
'**/__fixtures__/',
'**/*.d.ts',
];
export default defineConfig({
lint: {
plugins: ['oxc', 'typescript', 'unicorn', 'react', 'promise', 'import', 'node'],
jsPlugins: [
{
name: 'vite-plus',
specifier: 'vite-plus/oxlint-plugin',
},
],
categories: {
correctness: 'warn',
},
options: {
typeAware: true,
typeCheck: true,
},
env: {
builtin: true,
commonjs: true,
},
globals: mapGlobals(globals.node),
ignorePatterns: [
...ignorePatterns,
'**/*.json',
'**/*.snap',
'**/*.mdx',
'**/*.css',
'**/*.html',
'scenarios/',
],
},
fmt: {
singleQuote: true,
sortImports: true,
sortPackageJson: false,
ignorePatterns: [...ignorePatterns, '**/*.toml'],
overrides: [
{
files: ['**/*.{js,cjs,mjs,ts,tsx,cts,mts,html,css}'],
options: {
useTabs: true,
},
},
{
files: ['**/*.md'],
options: {
proseWrap: 'always',
},
},
],
},
test: {
include: ['packages/**/*.test.ts'],
environment: 'node',
globals: false,
},
pack: {
dts: {
build: true,
},
exports: {
legacy: true,
},
external: ['vscode'],
format: ['cjs'],
outDir: 'cjs',
platform: 'node',
sourcemap: true,
},
});