micromatch / micromatch/picomatch

default value of regex option is both true and false

Open
#101 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
135
Avg merge
23h 38m
Merged PRs (30d)
7

Description

If the regex option is not specified, the value is treated as true in some scenarios and false in others. Only by setting the option explicitly do you get consistent behavior.

Here's a case where the regex option defaults to true:

(a|b|c)+
//=> /^(?:(a|b|c)+)$/

Here's case where the regex option defaults to false:

(a|b|c)*
//=> /^(?:(a|b|c)[^/]*?\/?)$/

I'm willing to contribute a PR to address this inconsistency.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing both regex-option examples against the current picomatch behavior and trace the option handling that produces the different outputs. Done means the default behavior is consistent for both patterns, with regression coverage for the examples and explicit-option behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.