-
Notifications
You must be signed in to change notification settings - Fork 0
Fix TypeScript errors in designer-modes example #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TypeScript errors in designer-modes example #79
Conversation
- Remove unnecessary React import from App.tsx (jsx: react-jsx handles JSX automatically) - Update main.tsx to use named imports instead of namespace import - Add vite/client types to tsconfig for CSS import support Fixes TS6133 and TS2307 errors that were causing CI build failures Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes TypeScript compilation errors in the designer-modes example that were causing CI failures. The changes modernize the React imports to align with the automatic JSX runtime configuration and add missing type definitions for Vite's module resolution.
Changes:
- Removed redundant React namespace imports in favor of named imports
- Added Vite client types to tsconfig for CSS module declarations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/designer-modes/tsconfig.json | Added "types": ["vite/client"] to resolve CSS import type errors |
| examples/designer-modes/src/main.tsx | Changed to named imports (StrictMode, createRoot) instead of namespace imports |
| examples/designer-modes/src/App.tsx | Removed unused React namespace import, keeping only useState |
|
@copilot fix check |
|
@copilot fix type check |
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
✅ All checks passed!
|
The
designer-modesexample was failing CI type checks with TS6133 (unused React import) and TS2307 (CSS module not found).Changes
StrictMode,createRoot) instead of namespace imports"types": ["vite/client"]for CSS import type definitionsThe tsconfig already specified
"jsx": "react-jsx"which enables automatic JSX transformation, making the React namespace import redundant. Vite client types are required for module declarations like CSS imports.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.