-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathvite.config.ts
More file actions
132 lines (130 loc) · 5.34 KB
/
Copy pathvite.config.ts
File metadata and controls
132 lines (130 loc) · 5.34 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
131
132
import { defineConfig } from "vite-plus";
const rootVP = "node node_modules/vite-plus/bin/vp";
const frontendVP = "node ../node_modules/vite-plus/bin/vp";
const packageVP = "node ../../node_modules/vite-plus/bin/vp";
const effectDiagnostics =
"(cd frontend && node node_modules/@effect/language-service/cli.js diagnostics --project tsconfig.json --format text --severity error)";
export default defineConfig({
run: {
tasks: {
"frontend-check": {
command: [
`${rootVP} run frontend-fmt`,
`${rootVP} run frontend-lint`,
`${rootVP} run kit-ui-check`,
`${rootVP} run svelte-check`,
effectDiagnostics,
],
cache: false,
},
"kit-ui-check": {
command: `(cd frontend && node node_modules/@kenn-io/kit-ui/bin/kit-ui-check.mjs src)`,
cache: false,
},
"frontend-fmt": {
command: `${rootVP} fmt --check frontend packages/github-app-ui --no-error-on-unmatched-pattern --threads=1`,
cache: false,
},
"frontend-lint": {
command: `${rootVP} lint frontend packages/github-app-ui '!frontend/dist/**' '!packages/github-app-ui/dist/**' '!frontend/test-results/**' '!packages/github-app-ui/test-results/**' '!frontend/src/lib/api/generated/**' '!frontend/src/lib/api/roborev/generated/**' --no-error-on-unmatched-pattern --threads=1`,
cache: false,
},
"frontend-package-check": {
command: [
`${rootVP} fmt --check frontend --no-error-on-unmatched-pattern --threads=1`,
`${rootVP} run frontend-package-typecheck`,
],
cache: false,
},
"frontend-package-typecheck": {
command: [
`${rootVP} lint frontend '!frontend/dist/**' '!frontend/test-results/**' --no-error-on-unmatched-pattern --threads=1`,
`${rootVP} run svelte-check`,
effectDiagnostics,
],
cache: false,
},
// svelte-check behaves poorly with concurrent processes. Keep one task
// name and route package wrappers through it; cache hits keep repeated
// package-local typechecks cheap without exposing per-package tasks.
"svelte-check": {
command: [
`(cd frontend && ${frontendVP} exec -- svelte-check --config ./vite.config.ts --tsconfig ./tsconfig.json --fail-on-warnings)`,
`(cd packages/github-app-ui && ${packageVP} exec -- svelte-check --config ./vite.config.ts --tsconfig ./tsconfig.json --fail-on-warnings)`,
],
input: [
{ auto: true },
"!node_modules/.vite-temp/**",
"!frontend/node_modules/.vite-temp/**",
"!packages/github-app-ui/node_modules/.vite-temp/**",
"!node_modules/.vite/task-cache/**",
"!frontend/node_modules/.vite/task-cache/**",
"!packages/github-app-ui/node_modules/.vite/task-cache/**",
],
},
"github-app-ui-package-check": {
command: [
`${rootVP} fmt --check packages/github-app-ui --no-error-on-unmatched-pattern --threads=1`,
`${rootVP} run github-app-ui-package-typecheck`,
],
cache: false,
},
"github-app-ui-package-typecheck": {
command: [
`${rootVP} lint packages/github-app-ui '!packages/github-app-ui/dist/**' --no-error-on-unmatched-pattern --threads=1`,
`${rootVP} run svelte-check`,
],
cache: false,
},
},
},
staged: {
"*": `${rootVP} check --fix`,
},
fmt: {
ignorePatterns: [
"frontend/dist/**",
"packages/github-app-ui/dist/**",
"frontend/test-results/**",
"packages/github-app-ui/test-results/**",
"frontend/src/lib/api/generated/**",
"frontend/src/lib/api/roborev/generated/**",
],
printWidth: 120,
sortImports: false,
},
lint: {
ignorePatterns: [
"frontend/scripts/**",
"frontend/tests/**",
"frontend/src/**/*.test.ts",
"frontend/src/**/*.bench.test.ts",
"packages/github-app-ui/dist/**",
"packages/github-app-ui/test-results/**",
"frontend/src/lib/api/generated/**",
"frontend/src/lib/api/roborev/generated/**",
],
rules: {
// Oxlint does not yet model Svelte template writes reliably. Watch the
// embedded-framework RFC for the eventual fix path; the direct open
// evidence is a bind:this false positive in a related rule.
// https://github.com/oxc-project/oxc/discussions/21936
// https://github.com/oxc-project/oxc/issues/19470
// https://github.com/oxc-project/oxc/issues/15761
"eslint/no-unassigned-vars": "off",
// These type-aware rules are useful for cleanup work, but enabling them
// during the Vite+ migration would turn existing non-buggy code into
// unrelated churn that the previous frontend check never enforced.
"typescript/no-base-to-string": "off",
"typescript/no-duplicate-type-constituents": "off",
"typescript/no-floating-promises": "off",
"typescript/no-redundant-type-constituents": "off",
// Keep the migration scoped to tool consolidation; these style rules
// disagree with existing readable test and store code but do not affect
// the consistency gains from moving checks under Vite+.
"unicorn/no-useless-fallback-in-spread": "off",
"unicorn/prefer-string-starts-ends-with": "off",
},
options: { typeAware: true, typeCheck: true },
},
});