Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negation style ignores dot option? #251

Open
achingbrain opened this issue Apr 25, 2024 · 0 comments
Open

Negation style ignores dot option? #251

achingbrain opened this issue Apr 25, 2024 · 0 comments

Comments

@achingbrain
Copy link

If I have a path with a hidden file, input/.hidden.txt and a pattern that ignores some other file on the path, input/**/!(file.txt), micromatch matches the hidden file, even though the dot option is passed as false.

Minimatch does not match the pattern.

Neither micromatch nor minimatch match the pattern with the ! inside the parentheses: input/**/(!file.txt).

Is my pattern wrong or should micromatch support both styles as minimatch does?

Please describe the minimum necessary steps to reproduce this issue:

import micromatch from 'micromatch'
import { minimatch } from 'minimatch'

const input = 'input/.hidden.txt'
const pattern = 'input/**/!(file.txt)'

const opts = {
  dot: false
}

console.info('---- micromatch ----')

console.info(micromatch(input, pattern, opts))

console.info('---- minimatch ----')

console.info(minimatch(input, pattern, opts))

What is happening that shouldn't be?

% node index.js
---- micromatch ----
[ 'input/.hidden.txt' ]
---- minimatch ----
false

What should be happening instead?

% node index.js
---- micromatch ----
[]
---- minimatch ----
false
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

No branches or pull requests

1 participant