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>,