feat: update template

This commit is contained in:
2025-09-22 09:27:28 +08:00
parent 82d02516fe
commit 01abdfcbb6
5 changed files with 52 additions and 13 deletions

View File

@@ -9,18 +9,21 @@
"bracketSpacing": true, "bracketSpacing": true,
"arrowParens": "always", "arrowParens": "always",
"endOfLine": "lf", "endOfLine": "lf",
"plugins": [ "plugins": ["@ianvs/prettier-plugin-sort-imports"],
"@trivago/prettier-plugin-sort-imports" "importOrderParserPlugins": ["typescript", "jsx", "classProperties", "decorators-legacy"],
],
"importOrder": [ "importOrder": [
"^react$", "^react$",
"^@?\\w", "",
"^@/components/(.*)$", "<BUILTIN_MODULES>",
"^@/hooks/(.*)$", "<THIRD_PARTY_MODULES>",
"^@/utils/(.*)$", "",
"^[./]", "^@/[^/]+(/.*)?$",
"^.+\\.css$" "",
"^(?!.*[.](css|less)$)[./].*$",
"",
".*\\.(css|less)$"
], ],
"importOrderSeparation": true, "importOrderSeparation": true,
"importOrderSortSpecifiers": true "importOrderSortSpecifiers": true,
"importOrderCombineTypeAndValueImports": true
} }

View File

@@ -22,7 +22,10 @@ export default [
}, },
languageOptions: { languageOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,
globals: globals.browser, globals: {
...globals.browser,
...globals.node,
},
}, },
rules: { rules: {
...reactHooks.configs.recommended.rules, ...reactHooks.configs.recommended.rules,

View File

@@ -19,6 +19,7 @@
}, },
"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", "@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",

32
pnpm-lock.yaml generated
View File

@@ -18,6 +18,9 @@ importers:
'@eslint/js': '@eslint/js':
specifier: ^9.33.0 specifier: ^9.33.0
version: 9.35.0 version: 9.35.0
'@ianvs/prettier-plugin-sort-imports':
specifier: ^4.7.0
version: 4.7.0(prettier@3.6.2)
'@trivago/prettier-plugin-sort-imports': '@trivago/prettier-plugin-sort-imports':
specifier: ^5.2.2 specifier: ^5.2.2
version: 5.2.2(prettier@3.6.2) version: 5.2.2(prettier@3.6.2)
@@ -319,6 +322,24 @@ packages:
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
engines: {node: '>=18.18'} engines: {node: '>=18.18'}
'@ianvs/prettier-plugin-sort-imports@4.7.0':
resolution: {integrity: sha512-soa2bPUJAFruLL4z/CnMfSEKGznm5ebz29fIa9PxYtu8HHyLKNE1NXAs6dylfw1jn/ilEIfO2oLLN6uAafb7DA==}
peerDependencies:
'@prettier/plugin-oxc': ^0.0.4
'@vue/compiler-sfc': 2.7.x || 3.x
content-tag: ^4.0.0
prettier: 2 || 3 || ^4.0.0-0
prettier-plugin-ember-template-tag: ^2.1.0
peerDependenciesMeta:
'@prettier/plugin-oxc':
optional: true
'@vue/compiler-sfc':
optional: true
content-tag:
optional: true
prettier-plugin-ember-template-tag:
optional: true
'@jridgewell/gen-mapping@0.3.13': '@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
@@ -1870,6 +1891,17 @@ snapshots:
'@humanwhocodes/retry@0.4.3': {} '@humanwhocodes/retry@0.4.3': {}
'@ianvs/prettier-plugin-sort-imports@4.7.0(prettier@3.6.2)':
dependencies:
'@babel/generator': 7.28.3
'@babel/parser': 7.28.4
'@babel/traverse': 7.28.4
'@babel/types': 7.28.4
prettier: 3.6.2
semver: 7.7.2
transitivePeerDependencies:
- supports-color
'@jridgewell/gen-mapping@0.3.13': '@jridgewell/gen-mapping@0.3.13':
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/sourcemap-codec': 1.5.5

View File

@@ -1,9 +1,9 @@
import Home from '@/pages/home/index'
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 './index.css' import './index.css'
createRoot(document.getElementById('root')!).render( createRoot(document.getElementById('root')!).render(