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

Commit

Permalink
fix: ensure relative paths are used
Browse files Browse the repository at this point in the history
  • Loading branch information
smeijer committed Nov 18, 2023
1 parent 95a44c5 commit 5557783
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 } = {
Expand Down

0 comments on commit 5557783

Please sign in to comment.