From 63931164e24880aa9d626ce6b8f04136ba43f074 Mon Sep 17 00:00:00 2001 From: boulea7 Date: Thu, 13 Aug 2026 11:52:28 +0800 Subject: [PATCH] fix: allow component-no-space in config schema --- schemas/config.json | 2 +- test/schemas.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/schemas/config.json b/schemas/config.json index 2a751312b..1da4845ee 100644 --- a/schemas/config.json +++ b/schemas/config.json @@ -501,6 +501,6 @@ "snapshot-label": true, "initial-version": true, "exclude-paths": true, - "component-no-space": false + "component-no-space": true } } diff --git a/test/schemas.ts b/test/schemas.ts index 7a3a5efcb..b0468f3b6 100644 --- a/test/schemas.ts +++ b/test/schemas.ts @@ -67,5 +67,35 @@ describe('schemas', () => { expect(error.instancePath).to.eql(''); expect(error.params.additionalProperty).to.eql('extraField'); }); + + it('accepts component-no-space as a boolean', () => { + for (const componentNoSpace of [undefined, false, true]) { + const config = { + packages: { + '.': {}, + }, + ...(componentNoSpace === undefined + ? {} + : {'component-no-space': componentNoSpace}), + }; + expect(configValidator(config)).to.be.true; + expect(configValidator.errors).to.be.null; + } + }); + + it('rejects a non-boolean component-no-space', () => { + const config = { + packages: { + '.': {}, + }, + 'component-no-space': 'true', + }; + expect(configValidator(config)).to.be.false; + expect(configValidator.errors).lengthOf(1); + expect(configValidator.errors![0].instancePath).to.eql( + '/component-no-space' + ); + expect(configValidator.errors![0].message).to.eql('must be boolean'); + }); }); });