feat: add support for baseline years - #81
Conversation
|
Thanks for putting this together. I'm not sure how useful this feature is, so let's discuss back on #78 before iterating on the code. |
nzakas
left a comment
There was a problem hiding this comment.
Almost there, just left a few comments around optimization.
| // baseline year | ||
| type: "integer", | ||
| minimum: 2000, | ||
| maximum: new Date().getFullYear() + 1, |
There was a problem hiding this comment.
Double-checking: is this intentional? The max now would be 2026?
Or did you mean this?
| maximum: new Date().getFullYear() + 1, | |
| maximum: new Date().getFullYear() - 1, |
There was a problem hiding this comment.
Ah, yes this was intentional (see #81 (comment)) but I just realized the maximum is inclusive. My reasoning was that the current year is technically a valid Baseline year, ie https://web.dev/baseline/2025.
Fixed this to use the current year, but let me know if you'd still prefer YYYY - 1.
nzakas
left a comment
There was a problem hiding this comment.
LGTM. Thanks for all of your work on this.
Prerequisites checklist
What is the purpose of this pull request?
Adds the ability to configure the require-baseline rule to target a Baseline year as an alternative to newly or widely available status
What changes did you make? (Give an overview)
availableconfiguration property enumBaselineAvailabilityclass to determine whether a feature is supported based on the configRelated Issues
fixes #78
Is there anything you'd like reviewers to focus on?
For the rule schema, would you prefer to configure the baseline year as a separate optional property, rather than shoehorning it in with
available?