从0开始搭建一个前端项目(vue + vite + typescript)
- 版本
node:v22.17.1
pnpm:v10.13.1
vue:^3.5.18
vite:^7.0.6
typescipt:~5.8.0
- 脚手架初始化vue
pnpm create vue@latest
只选择: TypeScript, JSX
3. 用vscode打开创建的项目,并删除多余的代码
- eslint安装
参考:https://blog.csdn.net/hhhjjjj/article/details/150929338?spm=1011.2124.3001.6209
- tsconfig.json修改,删除 tsconfig.app.json和 tsconfig.node.json
{"compilerOptions": {"target": "esnext","jsx": "preserve","lib": ["esnext", "dom"],"experimentalDecorators": true,"baseUrl": ".","module": "esnext","moduleResolution": "node","paths": {"/@/*": ["src/*"]},"resolveJsonModule": true,"typeRoots": ["./node_modules/@types/", "./types"],"types": ["vite/client", "node"],"strict": true,"noUnusedLocals": true,"noUnusedParameters": true,"sourceMap": true,"allowSyntheticDefaultImports": true,"esModuleInterop": true,"forceConsistentCasingInFileNames": true,"skipLibCheck": true},"include": ["src/**/*.ts","src/**/*.tsx","src/**/*.vue","tests/**/*.ts","src/utils/path.js","types/**/*.d.ts","types/**/*.ts","types/global.d.ts","types/shims-tsx.d.ts","types/shims-vue.d.ts","mock/asyncRoutes.ts"],"exclude": ["node_modules", "dist", "**/*.js"]
}