chore: upgrade vite-plus to 0.1.17-alpha.4#4
Conversation
There was a problem hiding this comment.
Code Review
This pull request pins vite-plus and vitest to specific alpha versions, updates internal dependencies, and adds a pre-commit hook for staged files. It also adjusts TypeScript configurations, such as defining rootDir in plugin packages. Feedback recommends explicitly setting esModuleInterop to true in the root and web tsconfig.json files to improve module compatibility instead of relying on the default false value.
| "allowJs": false, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": false, | ||
| "allowSyntheticDefaultImports": true, |
There was a problem hiding this comment.
While removing the explicit false value is a good cleanup, TypeScript still defaults esModuleInterop to false. In modern projects, especially those using Vite and React, it is highly recommended to set "esModuleInterop": true. This ensures better compatibility with CommonJS modules and provides a more consistent experience when importing libraries that don't have a default export. Since allowSyntheticDefaultImports is already enabled, setting esModuleInterop to true is the preferred way to handle these imports correctly at both compile-time and runtime.
| "allowSyntheticDefaultImports": true, | |
| "esModuleInterop": true, | |
| "allowSyntheticDefaultImports": true, |
| "allowJs": false, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": false, | ||
| "allowSyntheticDefaultImports": true, |
There was a problem hiding this comment.
For web projects, enabling esModuleInterop is standard practice to avoid runtime issues with CommonJS dependencies. Instead of just removing the explicit false value, consider setting it to true to align with modern TypeScript standards and ensure robust module interop.
| "allowSyntheticDefaultImports": true, | |
| "esModuleInterop": true, | |
| "allowSyntheticDefaultImports": true, |
Upgrade vite-plus and related packages to 0.1.17-alpha.4