From 5bb4a965f5aef8dac7eb3016d2761a1d17d34c7a Mon Sep 17 00:00:00 2001 From: Marco Havermans Date: Fri, 13 Dec 2024 15:41:47 +0100 Subject: [PATCH 1/2] Add absolute option for finding files --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index ba515e3..60eb9ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,6 +30,7 @@ export default function createConfig({ .sync(['**/*.vue'], { cwd: rootDir, ignore: ['**/node_modules/**'], + absolute: true }) .reduce( (acc, file) => { From 02dc5f1a9188e47cb702062c9af24201bf2b1702 Mon Sep 17 00:00:00 2001 From: Marco Havermans Date: Mon, 16 Dec 2024 08:09:31 +0100 Subject: [PATCH 2/2] Only use absolutePath to read file contents --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 60eb9ca..e66caef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import vueParser from 'vue-eslint-parser' import pluginVue from 'eslint-plugin-vue' import fg from 'fast-glob' +import path from 'node:path' type ExtendableConfigName = keyof typeof tseslint.configs type ScriptLang = 'ts' | 'tsx' | 'js' | 'jsx' @@ -30,11 +31,11 @@ export default function createConfig({ .sync(['**/*.vue'], { cwd: rootDir, ignore: ['**/node_modules/**'], - absolute: true }) .reduce( (acc, file) => { - const contents = fs.readFileSync(file, 'utf8') + const absolutePath = path.resolve(rootDir, file) + const contents = fs.readFileSync(absolutePath, 'utf8') // contents matches the