Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
109 lines (107 loc) · 3.41 KB
/
Copy pathvite.config.ts
File metadata and controls
109 lines (107 loc) · 3.41 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
105
106
107
108
109
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite-plus'
export default defineConfig({
resolve: {
alias: { '@': fileURLToPath(new URL('.', import.meta.url)) },
},
test: {
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
exclude: [
'**/node_modules/**',
'**/.git/**',
'.next/**',
'.vercel/**',
'.playwright/**',
'.worktrees/**',
],
},
fmt: {
// Matches the previous Biome formatter settings and scope (JS/TS only).
singleQuote: true,
semi: false,
trailingComma: 'es5',
printWidth: 80,
sortImports: true,
ignorePatterns: [
'**/*.{md,mdx,json,jsonc,yml,yaml,css,html,toml}',
'next-env.d.ts',
'common/font.ts',
'common/twemoji.ts',
],
},
lint: {
jsPlugins: [{ name: 'vite-plus', specifier: 'vite-plus/oxlint-plugin' }],
plugins: ['typescript', 'unicorn', 'oxc', 'react', 'jsx-a11y', 'jest'],
ignorePatterns: ['next-env.d.ts', 'common/font.ts', 'common/twemoji.ts'],
// Ported from the previous Biome rule set; Oxlint's default correctness
// category covers the remaining Biome correctness/suspicious rules.
rules: {
'vite-plus/prefer-vite-plus-imports': 'error',
'jsx-a11y/alt-text': 'error',
'jsx-a11y/html-has-lang': 'error',
'no-extra-boolean-cast': 'error',
'no-useless-catch': 'error',
'no-useless-constructor': 'error',
'no-lone-blocks': 'error',
'no-useless-rename': 'error',
'no-unneeded-ternary': 'error',
'no-void': 'error',
'dot-notation': 'error',
'prefer-regex-literals': 'error',
'no-regex-spaces': 'error',
'no-sequences': 'error',
'react/no-children-prop': 'error',
'no-loss-of-precision': 'error',
'no-case-declarations': 'error',
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'react/exhaustive-deps': 'warn',
'react/rules-of-hooks': 'error',
'react/jsx-key': 'error',
'react/no-danger': 'error',
'no-eval': 'error',
'react/jsx-no-target-blank': 'error',
'prefer-const': 'error',
'one-var': ['error', 'never'],
'no-cond-assign': 'warn',
'no-async-promise-executor': 'error',
'no-ex-assign': 'error',
'no-class-assign': 'error',
'react/jsx-no-comment-textnodes': 'error',
'no-compare-neg-zero': 'error',
'no-labels': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-duplicate-case': 'error',
'no-dupe-class-members': 'error',
'react/jsx-no-duplicate-props': 'error',
'no-dupe-keys': 'error',
'no-empty': 'warn',
'jest/no-export': 'error',
'no-fallthrough': 'error',
'jest/no-focused-tests': 'error',
'no-func-assign': 'error',
'no-global-assign': 'error',
'no-import-assign': 'error',
'no-misleading-character-class': 'error',
'no-prototype-builtins': 'error',
'no-redeclare': 'error',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'warn',
'jest/no-disabled-tests': 'warn',
'no-unsafe-negation': 'error',
'default-case-last': 'error',
'no-with': 'error',
'no-var': 'warn',
},
options: { typeAware: true, typeCheck: true },
},
})