mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-28 09:16:47 +08:00
update: ts
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { render } from 'preact'
|
||||
export function App() {
|
||||
return <div>Hello</div>
|
||||
}
|
||||
|
||||
render(<App />, document.getElementById('app')!)
|
||||
@@ -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", "**/*"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import preact from '@preact/preset-vite'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [preact()],
|
||||
})
|
||||
Reference in New Issue
Block a user