From 181213526e33d4039626f7d78a887d514817ebef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Fri, 3 Jan 2025 17:06:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20JSPage=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=94=AF=E6=8C=81=20JavaScript=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=9B=B4=E6=96=B0=20ESLint=20=E5=92=8C=20Typ?= =?UTF-8?q?eScript=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 10 +++++++++- src/pages/JSPage/index.page.vue | 8 ++++++++ src/pages/JSPage/js-file.js | 3 +++ src/pages/{md-page.page.md => MDPage.page.md} | 0 src/pages/_1.page.vue | 3 --- tsconfig.app.json | 2 ++ typed-router.d.ts | 4 ++-- 7 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/pages/JSPage/index.page.vue create mode 100644 src/pages/JSPage/js-file.js rename src/pages/{md-page.page.md => MDPage.page.md} (100%) delete mode 100644 src/pages/_1.page.vue diff --git a/eslint.config.js b/eslint.config.js index 95a68e5..5a53d6f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,7 +27,7 @@ export default [ }, ...pluginVue.configs['flat/essential'], - ...vueTsEslintConfig({ supportedScriptLangs: { ts: true, tsx: true } }), + ...vueTsEslintConfig({ supportedScriptLangs: { ts: true, tsx: true, js: true, jsx: true } }), { ...pluginVitest.configs.recommended, @@ -41,6 +41,14 @@ export default [ rules: { 'vue/multi-word-component-names': 'off', '@typescript-eslint/no-explicit-any': 'off', + // 'vue/block-lang': [ + // 'error', + // { + // script: { + // allowNoLang: true, + // }, + // }, + // ], }, }, ]; diff --git a/src/pages/JSPage/index.page.vue b/src/pages/JSPage/index.page.vue new file mode 100644 index 0000000..82d63f3 --- /dev/null +++ b/src/pages/JSPage/index.page.vue @@ -0,0 +1,8 @@ + + + diff --git a/src/pages/JSPage/js-file.js b/src/pages/JSPage/js-file.js new file mode 100644 index 0000000..ad9fc03 --- /dev/null +++ b/src/pages/JSPage/js-file.js @@ -0,0 +1,3 @@ +export function fnInJsFile() { + return 'the function in js-file.js'; +} diff --git a/src/pages/md-page.page.md b/src/pages/MDPage.page.md similarity index 100% rename from src/pages/md-page.page.md rename to src/pages/MDPage.page.md diff --git a/src/pages/_1.page.vue b/src/pages/_1.page.vue deleted file mode 100644 index a65057e..0000000 --- a/src/pages/_1.page.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/tsconfig.app.json b/tsconfig.app.json index 72aa986..5840972 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -12,6 +12,8 @@ "exclude": ["src/**/__tests__/*"], "compilerOptions": { "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "allowJs": true, // 允许编译 JavaScript 文件 + "checkJs": true, // 启用 JavaScript 文件的类型检查 "types": [ "vite/client", // "vitest", diff --git a/typed-router.d.ts b/typed-router.d.ts index 5266570..70210d6 100644 --- a/typed-router.d.ts +++ b/typed-router.d.ts @@ -19,7 +19,6 @@ declare module 'vue-router/auto-routes' { */ export interface RouteNamedMap { 'Root': RouteRecordInfo<'Root', '/', Record, Record>, - '1': RouteRecordInfo<'1', '/_1', Record, Record>, '$Path': RouteRecordInfo<'$Path', '/:path(.*)', { path: ParamValue }, { path: ParamValue }>, '中文页面': RouteRecordInfo<'中文页面', '/中文-页面', Record, Record>, 'Api': RouteRecordInfo<'Api', '/api', Record, Record>, @@ -29,7 +28,8 @@ declare module 'vue-router/auto-routes' { 'Icons': RouteRecordInfo<'Icons', '/Icons', Record, Record>, 'InfiniteLoading': RouteRecordInfo<'InfiniteLoading', '/infinite-loading', Record, Record>, 'InfiniteLoadingDetail': RouteRecordInfo<'InfiniteLoadingDetail', '/infinite-loading/detail', Record, Record>, - 'MdPage': RouteRecordInfo<'MdPage', '/md-page', Record, Record>, + 'JSPage': RouteRecordInfo<'JSPage', '/JSPage', Record, Record>, + 'MDPage': RouteRecordInfo<'MDPage', '/MDPage', Record, Record>, 'Primevue': RouteRecordInfo<'Primevue', '/primevue', Record, Record>, 'Router': RouteRecordInfo<'Router', '/router', Record, Record>, 'SomePage': RouteRecordInfo<'SomePage', '/some-page', Record, Record>,