-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvite.config.ts
More file actions
130 lines (123 loc) · 3.93 KB
/
vite.config.ts
File metadata and controls
130 lines (123 loc) · 3.93 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { defineConfig } from "vite-plus";
// https://viteplus.dev/config/
export default defineConfig({
// Git hooks for staged files - https://viteplus.dev/guide/commit-hooks
staged: {
"*": "vp fmt --no-error-on-unmatched-pattern",
},
// Vite Task
// https://viteplus.dev/config/run
// https://viteplus.dev/guide/run
run: {
cache: {
// Disabled since Vite+ only replays terminal output, not build artifacts.
// Enable if your platform preserves build outputs between deployments.
// see: https://github.com/mugnavo/tanstarter-plus/issues/8
tasks: false,
},
},
// Oxfmt - https://oxc.rs/docs/guide/usage/formatter/config.html
fmt: {
tabWidth: 2,
semi: true,
printWidth: 100,
singleQuote: false,
endOfLine: "lf",
trailingComma: "all",
sortImports: {},
sortTailwindcss: {
stylesheet: "./packages/ui/styles/base.css",
attributes: ["class", "className"],
functions: ["clsx", "cn", "cva", "tw"],
},
sortPackageJson: true,
ignorePatterns: [
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock",
"bun.lock",
"routeTree.gen.ts",
".tanstack-start/",
".tanstack/",
"drizzle/",
"migrations/",
".drizzle/",
".cache",
"worker-configuration.d.ts",
".vercel",
".output",
".wrangler",
".netlify",
"dist",
],
},
// Oxlint - https://oxc.rs/docs/guide/usage/linter/config
lint: {
plugins: ["typescript", "react", "react-perf", "jsx-a11y"],
env: {
builtin: true,
node: true,
browser: true,
},
options: {
typeAware: true,
typeCheck: true,
},
jsPlugins: [
{ name: "react-hooks-js", specifier: "eslint-plugin-react-hooks" },
// Plugins with "/" in name have to be aliased for now
// Issue: https://github.com/oxc-project/oxc/issues/14557
{
name: "eslint-tanstack-router",
specifier: "@tanstack/eslint-plugin-router",
},
{
name: "eslint-tanstack-query",
specifier: "@tanstack/eslint-plugin-query",
},
],
rules: {
"no-deprecated": "warn",
"typescript/no-floating-promises": "off",
"typescript/no-misused-spread": "off",
"eslint-tanstack-router/create-route-property-order": "warn",
"eslint-tanstack-query/exhaustive-deps": "warn",
"eslint-tanstack-query/stable-query-client": "warn",
"eslint-tanstack-query/no-rest-destructuring": "warn",
"eslint-tanstack-query/no-unstable-deps": "warn",
"eslint-tanstack-query/infinite-query-property-order": "warn",
"eslint-tanstack-query/no-void-query-fn": "warn",
"eslint-tanstack-query/mutation-property-order": "warn",
// ref:
// - https://github.com/TheAlexLichter/oxlint-react-compiler-rules/issues/1
// - https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#custom-configuration
// Recommended rules (from LintRulePreset.Recommended)
"react-hooks-js/config": "error",
"react-hooks-js/error-boundaries": "error",
"react-hooks-js/gating": "error",
"react-hooks-js/globals": "error",
"react-hooks-js/immutability": "error",
"react-hooks-js/incompatible-library": "warn",
"react-hooks-js/preserve-manual-memoization": "error",
"react-hooks-js/purity": "error",
"react-hooks-js/refs": "error",
"react-hooks-js/set-state-in-effect": "warn",
"react-hooks-js/set-state-in-render": "error",
"react-hooks-js/static-components": "error",
"react-hooks-js/unsupported-syntax": "warn",
"react-hooks-js/use-memo": "error",
// Recommended-latest rules (from LintRulePreset.RecommendedLatest)
"react-hooks-js/void-use-memo": "error",
},
ignorePatterns: [
"dist",
".wrangler",
".vercel",
".netlify",
".output",
"build/",
"worker-configuration.d.ts",
"scripts/",
],
},
});