diff --git a/apps/vdn-static/eslint.config.js b/apps/vdn-static/eslint.config.js index 6bf661b..8d578f9 100644 --- a/apps/vdn-static/eslint.config.js +++ b/apps/vdn-static/eslint.config.js @@ -1,24 +1,44 @@ -import js from '@eslint/js'; -import globals from 'globals'; -import ts from 'typescript-eslint'; -import vue from 'eslint-plugin-vue'; +import js from "@eslint/js"; +import globals from "globals"; +import ts from "typescript-eslint"; +import vue from "eslint-plugin-vue"; +import { defineConfig, globalIgnores } from "eslint/config"; +import vueParser from "vue-eslint-parser"; -export default ts.config( - { ignores: ['dist'] }, - { - extends: [ - js.configs.recommended, - ...ts.configs.recommendedTypeChecked, - ...vue.configs.recommendedTypeChecked, - ], - files: ['**/*.{js,ts,vue}'], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser, - parserOptions: { - projectService: true, - tsconfigRootDir: import.meta.dirname, - }, - }, - }, -) +export default defineConfig([ + globalIgnores(["dist"]), + { + extends: [ + js.configs.recommended, + ts.configs.strictTypeChecked, + ...vue.configs["flat/essential"], + ], + files: ["./src/**/*.{js,ts,vue}"], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: globals.browser, + parser: vueParser, + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + parser: ts.parser, + extraFileExtensions: [".vue"], + }, + }, + rules: { + "vue/no-restricted-component-names": [ + "error", + { + name: "RouterLink", + message: "Use SmartLink instead of RouterLink.", + }, + ], + }, + }, + // disable multi-word-component-names for unplugin-vue-router + { + files: ["src/pages/**/*.vue"], + rules: { "vue/multi-word-component-names": "off" }, + }, +]); diff --git a/apps/vdn-static/package.json b/apps/vdn-static/package.json index 25a0d3c..dce6538 100644 --- a/apps/vdn-static/package.json +++ b/apps/vdn-static/package.json @@ -22,17 +22,20 @@ "vue-router": "^4.5.1" }, "devDependencies": { + "@eslint/js": "^9.39.2", "@repo/common": "workspace:*", "@vitejs/plugin-vue": "^5.2.3", "@vue/tsconfig": "^0.7.0", - "eslint": "^9.26.0", - "eslint-plugin-vue": "^10.1.0", + "eslint": "^9.39.2", + "eslint-plugin-vue": "^10.7.0", + "globals": "^17.3.0", "prettier": "^3.5.3", "sass": "^1.87.0", "typescript": "~5.8.3", - "typescript-eslint": "^8.32.1", + "typescript-eslint": "^8.55.0", "unplugin-vue-router": "^0.12.0", "vite": "^6.3.5", + "vue-eslint-parser": "^10.2.0", "vue-tsc": "^2.2.8" }, "packageManager": "pnpm@10.11.0" diff --git a/apps/vdn-static/src/App.vue b/apps/vdn-static/src/App.vue index 21b089e..28bdd82 100644 --- a/apps/vdn-static/src/App.vue +++ b/apps/vdn-static/src/App.vue @@ -4,6 +4,8 @@ import { ref, type Ref } from "vue"; import LocalePicker from "./components/organisms/LocalePicker.vue"; import { vOnClickOutside } from "@vueuse/components"; import { useLocale } from "./i18n"; +import { RouterLink, useRouter } from "vue-router"; +import SmartLink from "./components/organisms/SmartLink.vue"; const burgerOpen: Ref = ref(false); @@ -16,6 +18,11 @@ const closeBurger = (): void => { }; const locale = useLocale(); + +const router = useRouter(); +router.beforeEach(() => { + closeBurger(); +});