Files
testing-tool/tsconfig.json
2026-05-21 22:57:23 +08:00

54 lines
1.5 KiB
JSON

{
"extends": "./.wxt/tsconfig.json",
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"module": "ESNext", // 支持 import.meta
"moduleResolution": "Bundler", // 或者用 "Node"
"strict": true,
"resolveJsonModule": true,
/* --- 代码质量检查 --- */
// 声明了但没使用的变量报错(防止代码冗余)
"noUnusedLocals": true,
// 函数参数没使用报错
"noUnusedParameters": true,
// 函数必须有返回值,防止遗漏 return
"noImplicitReturns": true,
// switch 语句没有 break 时报错
"noFallthroughCasesInSwitch": true,
/* --- 路径与环境 --- */
// 确保包含 DOM 类型(解决 setTimeout、document 等报错)
"lib": ["DOM", "DOM.Iterable", "ESNext"],
// 编译目标设置为最新,WXT 底层 Vite 会处理降级兼容
"target": "ESNext",
"types": ["chrome", "webextension-polyfill", "@testing-library/jest-dom", "vitest/globals"],
"noImplicitAny": true,
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
// 确保包含你的源代码目录
"include": [
"entrypoints/**/*",
"pages/**/*",
"components/**/*",
"providers/**/*",
"utils/**/*",
"config/**/*",
"types/**/*",
"assets/**/*",
"hooks/**/*",
"lib/**/*",
"src/**/*",
".wxt/types/**/*.ts",
".wxt/types/*.d.ts",
"eslint.config.ts"
],
"exclude": ["node_modules", ".wxt", "dist"]
}