Skip to content

Move React template to TypeScript 7 - #229

Merged
timkpaine merged 1 commit into
mainfrom
react-typescript-7
Dec 1, 2026
Merged

timkpaine merged 1 commit into
mainfrom
react-typescript-7

Conversation

@timkpaine

Copy link
Copy Markdown
Member

TypeScript 6 and later check side-effect imports by default, so tsc --noEmit fails on import './styles.css' in main.tsx (TS2882). This is why python-project-templates/javascript-template-site-react#3 fails.

Add src/vite-env.d.ts with a reference to vite/client, which declares CSS modules, and raise typescript to ^7.0.2 to match the uitk-webawesome and Python JS templates. The SvelteKit templates stay on TypeScript 6 because SvelteKit needs the JavaScript compiler API.

TypeScript 6 and later check side-effect imports by default, so tsc rejected the styles.css import in main.tsx. Add the usual src/vite-env.d.ts reference to vite/client, which declares CSS modules, and raise typescript to ^7.0.2 to match the other JS templates.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine timkpaine added part: dependencies PRs or issues related to dependencies lang: javascript PRs or issues related to Javascript labels Dec 1, 2026
@timkpaine
timkpaine merged commit c1fb811 into main Dec 1, 2026
27 checks passed
@timkpaine
timkpaine deleted the react-typescript-7 branch December 1, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: javascript PRs or issues related to Javascript part: dependencies PRs or issues related to dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant