Skip to content

Fix TypeScript errors in designer-modes example - #79

Merged
huangyiirene merged 6 commits into
copilot/fix-action-run-issuefrom
copilot/update-action-run-parameters
Jan 15, 2026
Merged

Fix TypeScript errors in designer-modes example#79
huangyiirene merged 6 commits into
copilot/fix-action-run-issuefrom
copilot/update-action-run-parameters

Conversation

CopilotAI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

The designer-modes example was failing CI type checks with TS6133 (unused React import) and TS2307 (CSS module not found).

Changes

  • App.tsx: Remove unnecessary React namespace import (automatic JSX runtime doesn't require it)
  • main.tsx: Use named imports (StrictMode, createRoot) instead of namespace imports
  • tsconfig.json: Add "types": ["vite/client"] for CSS import type definitions
-import React, { useState } from 'react';+import { useState } from 'react';-import React from 'react';-import ReactDOM from 'react-dom/client';+import { StrictMode } from 'react';+import { createRoot } from 'react-dom/client';

The 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

引用: https://github.com/objectstack-ai/objectui/actions/runs/21026040003/job/60450980468#step:6:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- 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>
CopilotAI changed the title [WIP] Update action run parameters for better clarityFix TypeScript errors in designer-modes exampleJan 15, 2026
@huangyiirene
huangyiirene requested review from Copilot and removed request for huangyiireneJanuary 15, 2026 09:35

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
examples/designer-modes/tsconfig.jsonAdded "types": ["vite/client"] to resolve CSS import type errors
examples/designer-modes/src/main.tsxChanged to named imports (StrictMode, createRoot) instead of namespace imports
examples/designer-modes/src/App.tsxRemoved unused React namespace import, keeping only useState

@huangyiirene

Copy link
Copy Markdown
Collaborator

@copilot fix check

@huangyiirene

Copy link
Copy Markdown
Collaborator

@copilot fix type check

CopilotAIand others added 2 commits January 15, 2026 09:41
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@huangyiirene
huangyiirene marked this pull request as ready for review January 15, 2026 10:25
@huangyiirene
huangyiirene merged commit 1714bfc into copilot/fix-action-run-issueJan 15, 2026
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@huangyiirene@hotlong