-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
90 lines (89 loc) · 2.51 KB
/
vite.config.ts
File metadata and controls
90 lines (89 loc) · 2.51 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
import { defineConfig } from 'vite-plus';
export default defineConfig({
pack: {
entry: ['src/index.ts'],
format: 'cjs',
platform: 'node',
target: 'node24',
fixedExtension: false,
sourcemap: true,
deps: {
alwaysBundle: [/./],
},
},
test: {
environment: 'node',
testTimeout: 30000,
include: ['test/**/*.test.ts', 'test/**/*.spec.ts'],
exclude: ['node_modules', 'dist', 'src'],
globals: false,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: ['node_modules/', 'dist/', '**/*.test.ts', '**/*.spec.ts'],
},
},
staged: {
'*': 'vp check --fix',
},
lint: {
plugins: ['oxc', 'typescript', 'unicorn', 'react'],
categories: {
correctness: 'warn',
},
env: {
builtin: true,
},
ignorePatterns: ['dist/**', 'node_modules/**', '*.config.mjs'],
overrides: [
{
files: ['src/**/*.ts'],
rules: {
'no-array-constructor': 'error',
'no-unused-expressions': 'error',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'typescript/ban-ts-comment': 'error',
'typescript/no-duplicate-enum-values': 'error',
'typescript/no-empty-object-type': 'error',
'typescript/no-explicit-any': 'warn',
'typescript/no-extra-non-null-assertion': 'error',
'typescript/no-misused-new': 'error',
'typescript/no-namespace': 'error',
'typescript/no-non-null-asserted-optional-chain': 'error',
'typescript/no-require-imports': 'error',
'typescript/no-this-alias': 'error',
'typescript/no-unnecessary-type-constraint': 'error',
'typescript/no-unsafe-declaration-merging': 'error',
'typescript/no-unsafe-function-type': 'error',
'typescript/no-wrapper-object-types': 'error',
'typescript/prefer-as-const': 'error',
'typescript/prefer-namespace-keyword': 'error',
'typescript/triple-slash-reference': 'error',
'typescript/explicit-function-return-type': 'off',
},
},
],
options: {
typeAware: true,
typeCheck: true,
},
},
fmt: {
semi: true,
trailingComma: 'es5',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
useTabs: false,
arrowParens: 'always',
endOfLine: 'lf',
sortPackageJson: false,
ignorePatterns: ['dist/**'],
},
});