Compare commits

2 Commits

Author SHA1 Message Date
xy
01abdfcbb6 feat: update template 2025-09-22 09:27:28 +08:00
xy
82d02516fe feat: update template 2025-09-19 15:41:53 +08:00
8 changed files with 203 additions and 760 deletions

View File

@@ -8,5 +8,22 @@
"semi": false, "semi": false,
"bracketSpacing": true, "bracketSpacing": true,
"arrowParens": "always", "arrowParens": "always",
"endOfLine": "lf" "endOfLine": "lf",
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
"importOrderParserPlugins": ["typescript", "jsx", "classProperties", "decorators-legacy"],
"importOrder": [
"^react$",
"",
"<BUILTIN_MODULES>",
"<THIRD_PARTY_MODULES>",
"",
"^@/[^/]+(/.*)?$",
"",
"^(?!.*[.](css|less)$)[./].*$",
"",
".*\\.(css|less)$"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderCombineTypeAndValueImports": true
} }

View File

@@ -1,6 +1,5 @@
import js from '@eslint/js' import js from '@eslint/js'
import prettierConfig from 'eslint-config-prettier' import prettierConfig from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import prettierPlugin from 'eslint-plugin-prettier' import prettierPlugin from 'eslint-plugin-prettier'
import reactHooks from 'eslint-plugin-react-hooks' import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh' import reactRefresh from 'eslint-plugin-react-refresh'
@@ -20,7 +19,6 @@ export default [
'react-hooks': reactHooks, 'react-hooks': reactHooks,
'react-refresh': reactRefresh, 'react-refresh': reactRefresh,
prettier: prettierPlugin, prettier: prettierPlugin,
import: importPlugin,
}, },
languageOptions: { languageOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,
@@ -31,18 +29,7 @@ export default [
}, },
rules: { rules: {
...reactHooks.configs.recommended.rules, ...reactHooks.configs.recommended.rules,
'prettier/prettier': ['error', { endOfLine: 'auto' }], 'prettier/prettier': ['error'],
'import/order': [
'error',
{
groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
}, },
}, },
prettierConfig, prettierConfig,

View File

@@ -14,28 +14,23 @@
"type-check": "vue-tsc --build" "type-check": "vue-tsc --build"
}, },
"dependencies": { "dependencies": {
"@mantine/core": "^8.3.1",
"@mantine/hooks": "^8.3.1",
"react": "^19.1.1", "react": "^19.1.1",
"react-dom": "^19.1.1" "react-dom": "^19.1.1"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.33.0", "@eslint/js": "^9.33.0",
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/react": "^19.1.10", "@types/react": "^19.1.10",
"@types/react-dom": "^19.1.7", "@types/react-dom": "^19.1.7",
"@vitejs/plugin-react-swc": "^4.0.0", "@vitejs/plugin-react-swc": "^4.0.0",
"eslint": "^9.33.0", "eslint": "^9.33.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20", "eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0", "globals": "^16.3.0",
"less": "^4.4.1",
"postcss": "^8.5.6",
"postcss-preset-mantine": "^1.18.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"typescript": "~5.8.3", "typescript": "~5.8.3",
"typescript-eslint": "^8.39.1", "typescript-eslint": "^8.39.1",

875
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +0,0 @@
export default {
plugins: {
'postcss-preset-mantine': {},
'postcss-simple-vars': {
variables: {
'mantine-breakpoint-xs': '36em',
'mantine-breakpoint-sm': '48em',
'mantine-breakpoint-md': '62em',
'mantine-breakpoint-lg': '75em',
'mantine-breakpoint-xl': '88em',
},
},
},
};

View File

@@ -1 +0,0 @@
@import "@mantine/core/styles.css";

View File

@@ -1,24 +1,13 @@
import { createTheme, MantineProvider } from '@mantine/core'
import { StrictMode } from 'react' import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client'
import Home from '@/pages/home/index' import Home from '@/pages/home/index'
import './index.css' import './index.css'
const theme = createTheme({ createRoot(document.getElementById('root')!).render(
/** Put your mantine theme override here */ <StrictMode>
}) <Home />
</StrictMode>,
function App() { )
return (
<StrictMode>
<MantineProvider theme={theme}>
<Home />
</MantineProvider>
</StrictMode>
)
}
const root = createRoot(document.getElementById('root')!)
root.render(<App />)

View File

@@ -1,4 +1,3 @@
import { Button } from '@mantine/core'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
export default function Home() { export default function Home() {
@@ -9,9 +8,5 @@ export default function Home() {
}, []) }, [])
console.log(num) console.log(num)
return ( return <div>home</div>
<div>
<Button variant='filled'>Button</Button>;
</div>
)
} }