JEduardo-Chavez/CVEChavez2026
GitHub: JEduardo-Chavez/CVEChavez2026
这是一个使用 React 和 TypeScript 构建的现代化个人简历网页项目。
Stars: 0 | Forks: 0
# React + TypeScript + Vite
此模板提供了在 Vite 中使用 React 和 HMR 以及一些 ESLint 规则的最低设置。
目前,有两个官方插件可用:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) 使用 [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) 使用 [SWC](https://swc.rs/)
## React Compiler
此模板已启用 React Compiler。有关更多信息,请参阅[此文档](https://react.dev/learn/react-compiler)。
注意:这会影响 Vite 的开发和构建性能。
## 扩展 ESLint 配置
如果您正在开发生产环境应用程序,我们建议更新配置以启用类型感知的 lint 规则:
```
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
您还可以安装 [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) 和 [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) 以获取 React 专用的 lint 规则:
```
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
标签:CMS安全, ESLint, HMR, JavaScript, Oxc, React, React编译器, SWC, Syscalls, tsconfig, TypeScript, Vite, 代码规范, 前端工程化, 安全插件, 开发配置, 模板, 热更新, 类型检查, 脚手架, 自动化攻击