From 9903a63b19a40db28749ffd5b0eca67d00d78fd7 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Tue, 6 Sep 2022 22:01:13 +0100 Subject: [PATCH] lint releaseDate properly --- lib/frontmatter-linter.js | 3 +-- test/frontmatter-linter-test.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/frontmatter-linter.js b/lib/frontmatter-linter.js index 07cb906..8b0bf9e 100644 --- a/lib/frontmatter-linter.js +++ b/lib/frontmatter-linter.js @@ -93,7 +93,6 @@ module.exports = class FrontmatterLinter { }, 'release-date': { type: ['date', 'null'], - required: true, messages: { type: 'must be a date formatted YYYY-MM-DD', }, @@ -116,7 +115,7 @@ module.exports = class FrontmatterLinter { }, }; - this.defaultSchema = this.withRules(['stage', 'start-date', 'teams', 'prs']); + this.defaultSchema = this.withRules(['stage', 'start-date', 'teams', 'prs', 'release-date']); this.releasedOrLaterSchema = this.withRules([ 'stage', 'start-date', diff --git a/test/frontmatter-linter-test.js b/test/frontmatter-linter-test.js index a590828..5856baf 100644 --- a/test/frontmatter-linter-test.js +++ b/test/frontmatter-linter-test.js @@ -19,7 +19,7 @@ const emptyMetadata = `--- const nonExistentStageMarkdown = `--- stage: propsed start-date: 2020-01-01 -release-date: Unreleased +release-date: release-versions: ember-source: vX.Y.Z ember-data: vX.Y.Z @@ -155,6 +155,7 @@ describe('FrontmatterLinter', function () { 'prs.accepted must be the URL for the original pull request on emberjs/rfcs, for example: https://github.com/emberjs/rfcs/pull/123', 'start-date must be a date formatted YYYY-MM-DD', 'teams must be a list of one or more Ember teams', + 'release-date must be a date formatted YYYY-MM-DD', ]); });