update: ts

This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent cf79e2763b
commit ce44237466
380 changed files with 4806 additions and 221348 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineConfig } from 'eslint/config'
// @ts-ignore
import preact from 'eslint-config-preact'
import defaultConfig from '../../eslint.config.ts'
export default defineConfig([
defaultConfig,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: { ...preact.plugins },
rules: { ...preact.rules },
settings: { ...preact.settings },
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: {
...preact.parserOptions,
ecmaFeatures: {
jsx: true,
...preact.parserOptions?.ecmaFeatures,
},
},
},
},
])
+26
View File
@@ -0,0 +1,26 @@
{
"name": "@remake/web",
"type": "module",
"version": "3.0.0",
"author": "Vick Scarlet <vick@syaro.io>",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint",
"test": "vitest"
},
"dependencies": {
"preact": "^10.26.9",
"@remake/core": "workspace:*"
},
"devDependencies": {
"@preact/preset-vite": "^2.10.2",
"eslint-config-preact": "^2.0.0",
"vite": "^8.1.3",
"vitest": "^4.1.10"
},
"eslintConfig": {
"extends": "preact"
}
}
+6
View File
@@ -0,0 +1,6 @@
import { render } from 'preact'
export function App() {
return <div>Hello</div>
}
render(<App />, document.getElementById('app')!)
+39
View File
@@ -0,0 +1,39 @@
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
"types": ["preact"],
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"jsxImportSource": "preact",
"paths": {
"@/*": ["./src/*"],
"@assets/*": ["./assets/*"],
"react": ["./node_modules/preact/compat/"],
"react-dom": ["./node_modules/preact/compat/"]
},
// Some stricter flags (disabled by default)
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitAny": true
},
"include": ["node_modules/vite/client.d.ts", "**/*"]
}
+7
View File
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact()],
})