diff --git a/.eslintrc b/.eslintrc index 15d10e0..41aa2ef 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,17 +21,42 @@ "react-hooks" ], "rules": { - "indent": ["error", 2], - "linebreak-style": ["error", "unix"], - "quotes": ["error", "single"], - "semi": ["error", "always"], + "indent": [ + "error", + 2 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ], "react/react-in-jsx-scope": 0, "import-helpers/order-imports": [ "warn", { "newlinesBetween": "always", - "groups": ["module", ["parent", "sibling", "index"]], - "alphabetize": { "order": "asc", "ignoreCase": true } + "groups": [ + "module", + "/^@/", + "/^@assets/", + "/^@components/", + [ + "parent", + "sibling", + "index" + ] + ], + "alphabetize": { + "order": "asc", + "ignoreCase": true + } } ], "unused-imports/no-unused-imports": "error", @@ -52,4 +77,4 @@ "version": "detect" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 74976a1..ce6c94d 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "devDependencies": { "@commitlint/cli": "^17.6.7", "@commitlint/config-conventional": "^17.6.7", + "@types/node": "^20.14.12", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@types/styled-components": "^5.1.26", diff --git a/tsconfig.json b/tsconfig.json index a27c260..c04377c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,13 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { + "@/*": ["src/*"], + "@components/*": ["src/components/*"], + "@assets/*": ["src/assets/*"] + }, }, "include": ["src"], "references": [{ "path": "./tsconfig.node.json" }] diff --git a/vite.config.ts b/vite.config.ts index 4e7004e..5ba00c1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,16 @@ -import react from '@vitejs/plugin-react'; +import path from 'path'; import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + // https://vitejs.dev/config/ export default defineConfig({ + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + '@assets': path.resolve(__dirname, './src/assets'), + '@components': path.resolve(__dirname, './src/components'), + }, + }, plugins: [react()], });