The issue has been solved
If using noext: true
(or extension: false
, which is the same thing), and expandDirectories.extensions
, then no results will be returned.
Example:
globby.sync(dirPath, {
expandDirectories: {
// Must have more than one extension here.
extensions: ['md', 'txt'],
},
extension: false,
})

Would you be able to submit a pull request with one or more failing tests? That would help getting this fixed faster.
posted by sindresorhus over 6 years ago
posted by garyking over 6 years ago 
posted by IssueHuntBot about 6 years ago 
dir-glob
is appending all extensions to the glob pattern: tmp\\**\\*.{md,tmp}
. The option noext
turns extglob support off, so fast-glob
is unable to resolve the pattern.
@sindresorhus Should we just display a warning/error when both options are used simultaneously? That would of course need some kind of documentation.
posted by medusalix about 6 years ago
@medusalix According to the fast-glob
docs, the noext
options disables patterns like +(a|b))
. dir-glob
doesn't use that pattern syntax, it uses brace expansion, which is a different option nobrace
.
posted by sindresorhus about 6 years ago
@sindresorhus fast-glob
uses micromatch
, which turns tmp\\**\\*.{md,tmp}
into tmp/**/*.(md|tmp)
using brace expansion. When noext
is specified, literal parentheses get matched:
it('should match literal parens when noext is true (issue #116)', function() {
assert(mm.isMatch('a/(dir)', 'a/(dir)', {noext: true}));
});
posted by medusalix about 6 years ago
@sindresorhus We could just throw an error if noext: true
and expandDirectories.extensions
are used together.
posted by medusalix about 6 years ago
That sounds like a leaked implementation detail and should be reported to fast-glob
. Can you open an issue on fast-glob
about this?
But yes, we should still throw an error for now until it's fixed in fast-glob
.
posted by sindresorhus about 6 years ago
the issue I opened isn't actionable apparently.
posted by janat08 almost 6 years ago
posted by janat08 almost 6 years ago 
posted by issuehunt-app[bot] over 5 years ago