chore(lint): apply the main eslint config to vue files (#39545)

Vue files only got `eslint-plugin-vue` rules, so stylistic and
TypeScript rules never ran on them, and `import-x` could not see cycles
between `.ts` and `.vue` files.

- Apply the main ESLint config to `.vue` files
- Let `import-x` parse `.vue` files, which surfaced a cycle between
`repo-findfile.ts` and `RepoFileSearch.vue`
- Fix the resulting lint issues

`vue-eslint-parser` is added as a direct dependency because `import-x`
resolves parsers by package name, see
https://github.com/un-ts/eslint-plugin-import-x/issues/381.
This commit is contained in:
silverwind authored and GitHub committed 2026-10-03 00:47:13 +00:00
1 parent 986b0bcae0
commit 99573bde0e
12 files changed
+115 -112

No files matched your search

+3
View File
@@ -67,6 +67,8 @@ export function filterRepoFilesWeighted(files: Array<string>, filter: string) {
return filterResult;
}
export type RepoFilesFilter = typeof filterRepoFilesWeighted;
export function initRepoFileSearch() {
registerGlobalInitFunc('initRepoFileSearch', async (el) => {
const {default: RepoFileSearch} = await import('../components/RepoFileSearch.vue');
@@ -76,6 +78,7 @@ export function initRepoFileSearch() {
treeListUrl: el.getAttribute('data-tree-list-url'),
noResultsText: el.getAttribute('data-no-results-text'),
placeholder: el.getAttribute('data-placeholder'),
filterFiles: filterRepoFilesWeighted,
}).mount(el);
});
}