Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow minimatch to match hidden folders #4502

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class PackageJsons {
try {
const patterns = exclusions
.concat(IGNORED_PATTERNS)
.map(exclusion => new Minimatch(exclusion));
.map(exclusion => new Minimatch(exclusion, { dot: true }));
this.walkDirectory(path.posix.normalize(toUnixPath(dir)), patterns);
} catch (e) {
error(`Error while searching for package.json files: ${e}`);
Expand Down
8 changes: 4 additions & 4 deletions packages/jsts/tests/dependencies/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ describe('initialize package.json files', () => {
);

const moduleBsubmoduleBPJList = getNearestPackageJsons(
path.posix.join(baseDir, 'moduleB', 'submoduleB', 'index.js'),
path.posix.join(baseDir, 'moduleB', '.submoduleB', 'index.js'),
);
const moduleBsubmoduleBPJ = toUnixPath(
path.posix.join(baseDir, 'moduleB', 'submoduleB', 'package.json'),
path.posix.join(baseDir, 'moduleB', '.submoduleB', 'package.json'),
);

expect(basePJList).toHaveLength(1);
Expand All @@ -93,7 +93,7 @@ describe('initialize package.json files', () => {
__dirname,
'fixtures',
'moduleB',
'submoduleB',
'.submoduleB',
'subfolder1',
'subfolder2',
'subfolder3',
Expand All @@ -113,7 +113,7 @@ describe('initialize package.json files', () => {
['package.json'],
['moduleB', 'package.json'],
['moduleB', 'submoduleA', 'package.json'],
['moduleB', 'submoduleB', 'package.json'],
['moduleB', '.submoduleB', 'package.json'],
];
expect(getAllPackageJsons()).toEqual(
new Map(
Expand Down