Skip to content

Commit 96b54fe

Browse files
committed
allow unmatched globs in ignore
1 parent 070f531 commit 96b54fe

3 files changed

Lines changed: 12 additions & 27 deletions

File tree

‎.changeset/whole-gifts-accept.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@changesets/cli": minor
3+
"@changesets/config": minor
4+
---
5+
6+
Allow unmatched glob patterns in the `ignore` config option.

‎packages/config/src/parse.test.ts‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ describe("validateConfig", () => {
323323
config: { ignore: ["pkg-*", "!pkg-b", "@pkg/*"] },
324324
expected: { ...defaultConfig, ignore: ["pkg-a", "@pkg/a", "@pkg/b"] },
325325
},
326+
{
327+
name: "ignore: allows unmatched globs",
328+
pkgs: ["pkg-a", "pkg-b"],
329+
config: { ignore: ["not-a-valid-package"] },
330+
expected: { ...defaultConfig, ignore: [] },
331+
},
326332
{
327333
name: "privatePackages: false",
328334
config: { privatePackages: false },
@@ -522,18 +528,6 @@ describe("validateConfig", () => {
522528
config: { ignore: [123, "pkg-a"] },
523529
errors: ["Expected string"],
524530
},
525-
{
526-
name: "rule: ignoredPatternsExist",
527-
pkgs: [],
528-
config: { ignore: ["pkg-a"] },
529-
errors: ['Invalid path: The package or glob "pkg-a" does not match'],
530-
},
531-
{
532-
name: "rule: ignoredPatternsExist: glob",
533-
pkgs: [],
534-
config: { ignore: ["pkg-*"] },
535-
errors: ['Invalid path: The package or glob "pkg-*" does not match'],
536-
},
537531
// privatePackages
538532
{
539533
name: "privatePackages: should error when a public package depends on a private package skipped via privatePackages.version: false",

‎packages/config/src/rules.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,6 @@ const noFixedAndLinkedPackages: Rule = ({ config, errors }) => {
114114
}
115115
};
116116

117-
const ignoredPatternsExist: Rule = ({
118-
writtenConfig,
119-
packageNames,
120-
errors,
121-
}) => {
122-
if (writtenConfig.ignore == null || writtenConfig.ignore.length === 0) return;
123-
124-
errors.push(
125-
...getUnmatchedPatterns(writtenConfig.ignore, packageNames).map(
126-
(pkgOrGlob) => `ignore: ${invalidPathOrGlobMessage(pkgOrGlob)}`,
127-
),
128-
);
129-
};
130-
131117
// Validate that dependents of skipped packages are also skipped.
132118
// A package is "skipped" if it's in the ignore list, or if it's private
133119
// and privatePackages.version is false.
@@ -201,7 +187,6 @@ const rules: Rule[] = [
201187
linkedGroupsExist,
202188
noDuplicateLinkedPackages,
203189
noFixedAndLinkedPackages,
204-
ignoredPatternsExist,
205190
alsoSkipDependentsOfSkipped,
206191
noPrivateTagWithoutPrivateVersion,
207192
];

0 commit comments

Comments
 (0)