Skip to content

fix: discard slash extglob alternatives#304

Open
pupuking723 wants to merge 1 commit into
isaacs:mainfrom
pupuking723:fix/extglob-slash-alternatives
Open

fix: discard slash extglob alternatives#304
pupuking723 wants to merge 1 commit into
isaacs:mainfrom
pupuking723:fix/extglob-slash-alternatives

Conversation

@pupuking723

Copy link
Copy Markdown

Fixes #274.

This updates extglob path-part splitting so slash-containing alternatives are discarded instead of causing the whole extglob pattern to be treated as literal text.

Examples covered:

  • @(x|a|a/b)/* keeps the x and a alternatives and drops a/b
  • @(a|a/b)/* still matches a/*
  • @(a/b)/* remains non-matching instead of broadening the pattern

Verification:

  • npx prettier --check src/index.ts test/basic.js
  • npx oxlint src test
  • npm test

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.

a slash can break the extglob syntax

1 participant