Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

vite.config.ts

133 lines3.9 KB

1import "vite-plus/test/config";
2import { defineConfig } from "vite-plus";
3import * as NodeURL from "node:url";
4​
5export default defineConfig({
6 resolve: {
7 alias: {
8 "~": NodeURL.fileURLToPath(new URL("./apps/web/src", import.meta.url)),
9 },
10 },
11 test: {
12 environment: "node",
13 exclude: [
14 "**/.repos/**",
15 "**/node_modules/**",
16 "**/dist/**",
17 "**/dist-electron/**",
18 "**/.{idea,git,cache,output,temp}/**",
19 ],
20 hookTimeout: 60_000,
21 testTimeout: 60_000,
22 },
23 staged: {
24 // Formatter only for now — no lint or typecheck on commit.
25 "*": "vp fmt",
26 },
27 fmt: {
28 ignorePatterns: [
29 ".reference",
30 ".repos/**",
31 ".plans",
32 ".alchemy",
33 "dist",
34 "dist-electron",
35 "node_modules",
36 "pnpm-lock.yaml",
37 "*.tsbuildinfo",
38 "**/routeTree.gen.ts",
39 "apps/mobile/android/**",
40 "apps/mobile/ios/**",
41 "apps/web/public/mockServiceWorker.js",
42 "apps/web/src/lib/vendor/qrcodegen.ts",
43 "apps/mobile/uniwind-types.d.ts",
44 "*.icon/**",
45 ],
46 sortPackageJson: {},
47 overrides: [
48 {
49 files: [".devcontainer/devcontainer.json"],
50 options: {
51 trailingComma: "none",
52 },
53 },
54 ],
55 },
56 lint: {
57 ignorePatterns: [
58 ".repos",
59 ".repos/**",
60 "dist",
61 "dist-electron",
62 "node_modules",
63 "pnpm-lock.yaml",
64 "*.tsbuildinfo",
65 "**/routeTree.gen.ts",
66 "apps/mobile/android/**",
67 "apps/mobile/ios/**",
68 "apps/mobile/uniwind-types.d.ts",
69 ],
70 plugins: ["eslint", "oxc", "react", "unicorn", "typescript"],
71 jsPlugins: ["./oxlint-plugin-t3code/index.ts"],
72 categories: {
73 correctness: "warn",
74 suspicious: "warn",
75 perf: "warn",
76 },
77 rules: {
78 "unicorn/no-array-sort": "off",
79 "unicorn/consistent-function-scoping": "off",
80 "oxc/no-map-spread": "off",
81 "react-in-jsx-scope": "off",
82 "react-hooks/exhaustive-deps": "off",
83 "eslint/no-shadow": "off",
84 "eslint/no-await-in-loop": "off",
85 "eslint/no-underscore-dangle": "off",
86 "typescript/consistent-return": "off",
87 "typescript/no-base-to-string": "off",
88 "typescript/no-duplicate-type-constituents": "off",
89 "typescript/no-floating-promises": "off",
90 "typescript/no-implied-eval": "off",
91 "typescript/no-meaningless-void-operator": "off",
92 "typescript/no-redundant-type-constituents": "off",
93 "typescript/no-unnecessary-boolean-literal-compare": "off",
94 "typescript/no-unnecessary-type-conversion": "off",
95 "typescript/no-unnecessary-type-arguments": "off",
96 "typescript/no-unnecessary-type-assertion": "off",
97 "typescript/no-unnecessary-type-parameters": "off",
98 "typescript/no-unsafe-type-assertion": "off",
99 "typescript/await-thenable": "off",
100 "typescript/require-array-sort-compare": "off",
101 "typescript/restrict-template-expressions": "off",
102 "typescript/unbound-method": "off",
103 "eslint/no-restricted-imports": [
104 "error",
105 {
106 paths: [
107 {
108 name: "@t3tools/client-runtime",
109 message:
110 "Import from an explicit @t3tools/client-runtime/* subpath. The package has no root export.",
111 },
112 {
113 name: "@pierre/diffs/react",
114 importNames: ["CodeView"],
115 message:
116 "Use StyledDiffCodeView so web diff surfaces share styling and virtualized geometry.",
117 },
118 ],
119 },
120 ],
121 "t3code/no-global-process-runtime": "error",
122 "t3code/no-inline-schema-compile": "warn",
123 "t3code/no-manual-effect-runtime-in-tests": "error",
124 "t3code/no-native-title-tooltip": "error",
125 "t3code/namespace-node-imports": "error",
126 },
127 options: {
128 // Revisit once Oxlint's tsgolint path can integrate with @effect/tsgo diagnostics.
129 typeAware: false,
130 typeCheck: false,
131 },
132 },
133});