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

fix: ensure relative paths are used #194

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading