Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Commit 7c1937e

Browse files
committed
fix: ensure relative paths are used
1 parent ae553ff commit 7c1937e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/process.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import ignore from 'ignore';
22
import { TraverseResult } from './traverse';
33
import { Context } from './index';
44
import { ensureArray } from './ensureArray';
5-
import path from 'path';
65
import { exists, readText } from './fs';
76

87
export interface ProcessedResult {
@@ -52,13 +51,7 @@ export async function processResults(
5251
if (context.config.respectGitignore && (await exists('.gitignore'))) {
5352
const gitignore = (await readText('.gitignore')).split('\n');
5453
const ig = ignore().add(gitignore);
55-
unimported = ig
56-
.filter(
57-
unimported.map((x) =>
58-
path.relative(context.cwd, path.resolve(context.cwd, x)),
59-
),
60-
)
61-
.map((x) => path.join(context.cwd, x));
54+
unimported = unimported.filter((x) => !ig.ignores(x));
6255
}
6356

6457
const formatTypeResultMap: { [P in FormatTypes]: boolean } = {

0 commit comments

Comments
 (0)