sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Do not ignore pattern start with `./` #267

Open zanminkian opened 2 months ago

zanminkian commented 2 months ago

This PR fix 2 issues:

Issue 1: trim gitignore file content

Issue 2: pattern starts with ./ or ./ should not be ignored

foo
├── .gitignore ---> content: ./bar.js
└── bar.js ---> should not be ignored, but actually ignored by globby
fisker commented 2 months ago
  • Handle trailing whitespaces:
    • 'a '(one space) should not match 'a '(two spaces).
    • 'a \ ' matches `'a '

Quote from https://github.com/kaelzhang/node-ignore/tree/master?tab=readme-ov-file#why-another-ignore. It seems spaces are useful.

zanminkian commented 2 months ago

I'm not pretty sure about issue 1 so I updated this PR.