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

vite.config.ts

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