Skip to content

Leading './' is not included in the glob regex #199

Open
@valerybugakov

Description

@valerybugakov

Minimum necessary steps to reproduce this issue:

const testGlob = '**/*.js';

console.log(micromatch.isMatch('./something/file.js', testGlob));
console.log(micromatch.isMatch('something/file.js', testGlob));
console.log(micromatch.makeRe(testGlob).test('./something/file.js'));
console.log(micromatch.makeRe(testGlob).test('something/file.js'));

What is happening that shouldn't be?

Output

true
true
false
true

What should be happening instead?

Expected

true
true
true
true

This issue is the exact duplicate of #110. It was resolved in nanomatch long ago. It works correctly using makeRe from nanomatch.

Should it be fixed in the same way in micromatch, probably in picomatch that is used under the hood?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions