Skip to content

Conversation

@43081j
Copy link
Collaborator

@43081j 43081j commented Aug 26, 2025

An ignore path can be relative.

For example:

  • ignore folder can be /foo/configs
  • file can be /foo/src/index.ts
  • the ignore file can be /foo/configs/.prettierignore
  • the ignore contents can be ../src/index.ts

This means we end up doing:

// does not fall back to path.relative
fastRelativeChildPath('/foo/configs', '/foo/src/index.ts');
// undefined

Which fails since we actually need fastRelativePath:

// falls back to path.relative
fastRelativePath('/foo/configs', '/foo/src/index.ts');
// ../src/index.ts

Fixes #82

An ignore path can be relative.

For example:

- folder can be `/foo/configs`
- file can be `/foo/src/index.ts`
- the ignore file can be `/foo/configs/.prettierignore`
- the ignore contents can be `../src/index.ts`

This means we end up doing:

```
// does not fall back to path.relative
fastRelativeChildPath('/foo/configs', '/foo/src/index.ts');
```

Which fails since we actually need `fastRelativePath`:

```
// falls back to path.relative
fastRelativePath('/foo/configs', '/foo/src/index.ts');
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--ignore-path doesn't work in new CLI

2 participants