ionic-team / ionic-team/ionic-cli
Eslint and Vite errors after scaffolding new react project
- 主要語言
- TypeScript
- 星號
- 2k
- 分支
- 682
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**Description:**
After creating new project using ionic-cli some error messages were discovered
1. Error [ERR_REQUIRE_ESM]: Cannot read config file: //.eslintrc.js
2. TS2345: Argument of type '{ plugins: PluginOption[][]; test: { globals: boolean; environment: string; setupFiles: string; }; }' is not assignable to parameter of type 'UserConfigExport'.
3. ESLint: Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
**Steps to Reproduce:**
ionic start -> choose react with side menu -> check tsx files and vite.config
**Possible solutions**
1. rename .eslintrc.js to .eslintrc.cjs
2. take eslint config and eslint plugins from default vite react app (yarn create vite)
貢獻指南
研究方向
Reproduce the issue with `ionic start`, choosing React with the side menu, then inspect the generated `.eslintrc.js`, `vite.config`, and TSX files. Compare the generated configuration with the default Vite React app and verify that the reported ESLint, ESM, and TypeScript errors no longer occur.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- eslint, react, typescript, vite
- 領域
- cli, frontend, tooling
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100