diff --git a/.pre-commit-eslint.sh b/.pre-commit-eslint.sh index 9ebb3e8..b2d6cd4 100755 --- a/.pre-commit-eslint.sh +++ b/.pre-commit-eslint.sh @@ -2,5 +2,5 @@ cd web > /dev/null if [[ -f "./node_modules/.bin/eslint" ]]; then ARGS=("$@") - eslint ${ARGS[@]/#web\// } + eslint --fix ${ARGS[@]/#web\// } fi diff --git a/web/eslint.config.js b/web/eslint.config.js index 8b8e9e9..81f1bdf 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -37,6 +37,10 @@ export default tseslint.config( "named": true, "warnOnUnassignedImports": true, "pathGroups": [{ + "pattern": "@/**", + "group": "parent", + "position": "before", + }, { "pattern": "*.svg?react", "patternOptions": {"matchBase": true}, "group": "sibling", diff --git a/web/tsconfig.json b/web/tsconfig.json index e618c22..08c0723 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -7,6 +7,9 @@ "DOM", "DOM.Iterable" ], + "paths": { + "@/*": ["./src/*"] + }, "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ diff --git a/web/vite.config.ts b/web/vite.config.ts index cf2bf39..e19cad4 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -13,6 +13,11 @@ export default defineConfig({ }, }), ], + resolve: { + alias: { + "@": "/src", + }, + }, server: { proxy: { "/_gomuks/websocket": {