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

vite.config.ts

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