From 5557783647a91e363680ba59be4b65fa9880b8a7 Mon Sep 17 00:00:00 2001 From: Stephan Meijer Date: Sat, 18 Nov 2023 15:23:51 +0100 Subject: [PATCH] fix: ensure relative paths are used --- src/process.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/process.ts b/src/process.ts index 6920c4c..85d1eda 100644 --- a/src/process.ts +++ b/src/process.ts @@ -2,7 +2,6 @@ import ignore from 'ignore'; import { TraverseResult } from './traverse'; import { Context } from './index'; import { ensureArray } from './ensureArray'; -import path from 'path'; import { exists, readText } from './fs'; export interface ProcessedResult { @@ -52,13 +51,7 @@ export async function processResults( if (context.config.respectGitignore && (await exists('.gitignore'))) { const gitignore = (await readText('.gitignore')).split('\n'); const ig = ignore().add(gitignore); - unimported = ig - .filter( - unimported.map((x) => - path.relative(context.cwd, path.resolve(context.cwd, x)), - ), - ) - .map((x) => path.join(context.cwd, x)); + unimported = unimported.filter((x) => !ig.ignores(x)); } const formatTypeResultMap: { [P in FormatTypes]: boolean } = {