Skip to content

Commit 2d72110

Browse files
feat: react typescript setup (#62)
* feat: react typescript setup * feat: ts
1 parent de0ee67 commit 2d72110

File tree

8 files changed

+62
-8
lines changed

8 files changed

+62
-8
lines changed

templates/react-ts-starter/juno.dev.config.js renamed to templates/react-ts-starter/juno.dev.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {defineDevConfig} from '@junobuild/config';
22

3-
/** @type {import('@junobuild/config').JunoDevConfig} */
43
export default defineDevConfig(() => ({
54
satellite: {
65
collections: {

templates/react-ts-starter/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build",
8+
"build": "tsc -b && vite build",
99
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview",
1111
"format": "prettier --write .",
@@ -32,6 +32,8 @@
3232
"postcss": "^8.4.49",
3333
"prettier": "^3.4.2",
3434
"tailwindcss": "^3.4.16",
35+
"typescript": "^5.7.3",
36+
"typescript-eslint": "^8.20.0",
3537
"vite": "^6.0.3",
3638
"vite-plugin-node-polyfills": "^0.22.0"
3739
},
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
3-
import App from './App'
43
import './index.css'
4+
import App from './App.tsx'
55

6-
createRoot(document.getElementById('root')).render(
6+
createRoot(document.getElementById('root')!).render(
77
<StrictMode>
88
<App />
9-
</StrictMode>
9+
</StrictMode>,
1010
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4+
"target": "ES2020",
5+
"useDefineForClassFields": true,
6+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
7+
"module": "ESNext",
8+
"skipLibCheck": true,
9+
10+
/* Bundler mode */
11+
"moduleResolution": "bundler",
12+
"allowImportingTsExtensions": true,
13+
"isolatedModules": true,
14+
"moduleDetection": "force",
15+
"noEmit": true,
16+
"jsx": "react-jsx",
17+
18+
/* Linting */
19+
"strict": true,
20+
"noUnusedLocals": true,
21+
"noUnusedParameters": true,
22+
"noFallthroughCasesInSwitch": true,
23+
"noUncheckedSideEffectImports": true
24+
},
25+
"include": ["src"]
26+
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"compilerOptions": {
3-
"jsx": "react-jsx"
4-
}
2+
"files": [],
3+
"references": [
4+
{ "path": "./tsconfig.app.json" },
5+
{ "path": "./tsconfig.node.json" }
6+
]
57
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4+
"target": "ES2022",
5+
"lib": ["ES2023"],
6+
"module": "ESNext",
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"isolatedModules": true,
13+
"moduleDetection": "force",
14+
"noEmit": true,
15+
16+
/* Linting */
17+
"strict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"noUncheckedSideEffectImports": true
22+
},
23+
"include": ["vite.config.ts"]
24+
}

0 commit comments

Comments
 (0)