b79fe7dd49
Move all source code directories into src/ for cleaner project structure: - pages/, components/, utils/, config/, providers/, types/, lib/, assets/, entrypoints/ → src/ - Use WXT srcDir config to resolve @/ alias to src/ - Update tsconfig, vitest, eslint, tailwind configs - Remove scattered README.md files from subdirectories - Update documentation (AGENTS.md, CODING_STANDARDS.md, README.md) - Fix pre-existing lint error in RouterProvider.tsx Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
35 lines
1.2 KiB
JSON
35 lines
1.2 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
|
|
},
|
|
// 确保包含你的源代码目录
|
|
"include": ["src/**/*", ".wxt/types/**/*.ts", ".wxt/types/*.d.ts", "eslint.config.ts"],
|
|
"exclude": ["node_modules", ".wxt", "dist"]
|
|
}
|