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

vite.config.ts

132 lines4.0 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 --no-error-on-unmatched-pattern",
26 },
27 fmt: {
28 ignorePatterns: [
29 ".reference",
30 ".repos/**",
31 ".alchemy",
32 "dist",
33 "dist-electron",
34 "node_modules",
35 "pnpm-lock.yaml",
36 "*.tsbuildinfo",
37 "**/routeTree.gen.ts",
38 "apps/mobile/android/**",
39 "apps/mobile/ios/**",
40 "apps/web/src/lib/vendor/qrcodegen.ts",
41 "apps/mobile/uniwind-types.d.ts",
42 "*.icon/**",
43 ],
44 sortPackageJson: {},
45 overrides: [
46 {
47 files: [".devcontainer/devcontainer.json"],
48 options: {
49 trailingComma: "none",
50 },
51 },
52 ],
53 },
54 lint: {
55 ignorePatterns: [
56 ".repos",
57 ".repos/**",
58 "dist",
59 "dist-electron",
60 "node_modules",
61 "pnpm-lock.yaml",
62 "*.tsbuildinfo",
63 "**/routeTree.gen.ts",
64 "apps/mobile/android/**",
65 "apps/mobile/ios/**",
66 "apps/mobile/uniwind-types.d.ts",
67 ],
68 plugins: ["eslint", "oxc", "react", "unicorn", "typescript"],
69 jsPlugins: ["./oxlint-plugin-t3code/index.ts"],
70 categories: {
71 correctness: "warn",
72 suspicious: "warn",
73 perf: "warn",
74 },
75 rules: {
76 "unicorn/no-array-sort": "off",
77 "unicorn/consistent-function-scoping": "off",
78 "oxc/no-map-spread": "off",
79 "react-in-jsx-scope": "off",
80 "react-hooks/exhaustive-deps": "off",
81 "eslint/no-shadow": "off",
82 "eslint/no-await-in-loop": "off",
83 "eslint/no-underscore-dangle": "off",
84 "typescript/consistent-return": "off",
85 "typescript/no-base-to-string": "off",
86 "typescript/no-duplicate-type-constituents": "off",
87 "typescript/no-floating-promises": "off",
88 "typescript/no-implied-eval": "off",
89 "typescript/no-meaningless-void-operator": "off",
90 "typescript/no-redundant-type-constituents": "off",
91 "typescript/no-unnecessary-boolean-literal-compare": "off",
92 "typescript/no-unnecessary-type-conversion": "off",
93 "typescript/no-unnecessary-type-arguments": "off",
94 "typescript/no-unnecessary-type-assertion": "off",
95 "typescript/no-unnecessary-type-parameters": "off",
96 "typescript/no-unsafe-type-assertion": "off",
97 "typescript/await-thenable": "off",
98 "typescript/require-array-sort-compare": "off",
99 "typescript/restrict-template-expressions": "off",
100 "typescript/unbound-method": "off",
101 "eslint/no-restricted-imports": [
102 "error",
103 {
104 paths: [
105 {
106 name: "@t3tools/client-runtime",
107 message:
108 "Import from an explicit @t3tools/client-runtime/* subpath. The package has no root export.",
109 },
110 {
111 name: "@pierre/diffs/react",
112 importNames: ["CodeView"],
113 message:
114 "Use StyledDiffCodeView so web diff surfaces share styling and virtualized geometry.",
115 },
116 ],
117 },
118 ],
119 "t3code/no-global-process-runtime": "error",
120 "t3code/no-inline-schema-compile": "warn",
121 "t3code/no-manual-effect-runtime-in-tests": "error",
122 "t3code/no-mobile-uniwind-theme-escape-hatches": "error",
123 "t3code/no-native-title-tooltip": "error",
124 "t3code/namespace-node-imports": "error",
125 },
126 options: {
127 // Revisit once Oxlint's tsgolint path can integrate with @effect/tsgo diagnostics.
128 typeAware: false,
129 typeCheck: false,
130 },
131 },
132});