chore: upgrade vite-plus to 0.1.16-alpha.4#3
Conversation
There was a problem hiding this comment.
Code Review
This pull request pins vite-plus and vitest to version 0.1.16-alpha.4 and updates numerous dependencies, including oxc-project and oxlint packages. Configuration changes include adding rootDir to package TSConfigs and introducing a staged check in vite.config.ts. Feedback suggests setting esModuleInterop to true for better module compatibility, narrowing the file glob for staged checks to avoid non-code assets, and removing redundant linting steps in the pre-commit hook.
| @@ -1 +1,2 @@ | |||
| vp lint | |||
| vp staged | |||
There was a problem hiding this comment.
Running both vp lint and vp staged in the pre-commit hook is likely redundant. vp staged is typically used to run checks only on changed files to speed up the commit process. If vp lint performs a full project check, it should be removed from the pre-commit hook to avoid duplicate work and improve performance.
| "useDefineForClassFields": true, | ||
| "allowJs": false, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": false, |
There was a problem hiding this comment.
Instead of just removing "esModuleInterop": false, it is recommended to set it to true. This is the modern standard for TypeScript projects, ensuring better compatibility with CommonJS modules and simplifying the configuration as it automatically enables allowSyntheticDefaultImports.
| "esModuleInterop": false, | |
| "esModuleInterop": true, |
| "useDefineForClassFields": true, | ||
| "allowJs": false, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": false, |
There was a problem hiding this comment.
Instead of just removing "esModuleInterop": false, it is recommended to set it to true. This is the modern standard for TypeScript projects, ensuring better compatibility with CommonJS modules and simplifying the configuration as it automatically enables allowSyntheticDefaultImports.
| "esModuleInterop": false, | |
| "esModuleInterop": true, |
|
|
||
| export default defineConfig({ | ||
| staged: { | ||
| "*": "vp check --fix", |
There was a problem hiding this comment.
Using a broad glob like "*" in the staged configuration will run vp check --fix on every staged file, including non-code assets (images, etc.). It is better to restrict this to relevant file extensions to avoid unnecessary processing.
| "*": "vp check --fix", | |
| "**/*.{ts,js,tsx,json,css}": "vp check --fix", |
Upgrade vite-plus and related packages to 0.1.16-alpha.4 alpha version.