diff --git a/.prettierrc.json b/.prettierrc.json index 391a1f0..ed260dc 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -9,18 +9,21 @@ "bracketSpacing": true, "arrowParens": "always", "endOfLine": "lf", - "plugins": [ - "@trivago/prettier-plugin-sort-imports" - ], + "plugins": ["@ianvs/prettier-plugin-sort-imports"], + "importOrderParserPlugins": ["typescript", "jsx", "classProperties", "decorators-legacy"], "importOrder": [ "^react$", - "^@?\\w", - "^@/components/(.*)$", - "^@/hooks/(.*)$", - "^@/utils/(.*)$", - "^[./]", - "^.+\\.css$" + "", + "", + "", + "", + "^@/[^/]+(/.*)?$", + "", + "^(?!.*[.](css|less)$)[./].*$", + "", + ".*\\.(css|less)$" ], "importOrderSeparation": true, - "importOrderSortSpecifiers": true + "importOrderSortSpecifiers": true, + "importOrderCombineTypeAndValueImports": true } diff --git a/eslint.config.js b/eslint.config.js index e30930e..090262c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -22,7 +22,10 @@ export default [ }, languageOptions: { ecmaVersion: 2020, - globals: globals.browser, + globals: { + ...globals.browser, + ...globals.node, + }, }, rules: { ...reactHooks.configs.recommended.rules, diff --git a/package.json b/package.json index 760c5aa..8f3fa3d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "devDependencies": { "@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-dom": "^19.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 000d741..1237fd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,9 @@ importers: '@eslint/js': specifier: ^9.33.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': specifier: ^5.2.2 version: 5.2.2(prettier@3.6.2) @@ -319,6 +322,24 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} 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': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1870,6 +1891,17 @@ snapshots: '@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': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 diff --git a/src/main.tsx b/src/main.tsx index b49051f..9af1a59 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,9 +1,9 @@ -import Home from '@/pages/home/index' - import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' +import Home from '@/pages/home/index' + import './index.css' createRoot(document.getElementById('root')!).render(