-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Migration 005 (linter): Enforce version order in linter/test-versions #7399
Conversation
Let's wait on #5352, which includes the migration code to clean up the data first? Since this is such a big change, we should stick with the migration process. |
Yeah, I found there is a prior work, didn't see that 😔. Fortunately not a complete duplicate, though. |
Couple of other things as well:
|
160bf68
to
94b6c55
Compare
94b6c55
to
ecd38dd
Compare
@saschanaz you might want to weigh in on #5352 as well. The precise rules for what order we require are pretty nuanced, and I think will require a bit of back and forth to get right. |
* @param {VersionValue} xver | ||
* @param {VersionValue} yver | ||
*/ | ||
function compareVersionNumber(xver, yver) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to handle "preview" as well, which didn't exist when you started this lint. That also makes "number" in the name inaccurate.
*/ | ||
function toArray(version) { | ||
if (typeof version === 'string') { | ||
return (version.startsWith('≤') ? version.slice(1) : version).split('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use compare-versions to compare versions (with "≤" removed first).
* @param {string} relPath | ||
* @param {Logger} logger | ||
*/ | ||
function checkVersionOrder(supportDataList, relPath, browser, logger) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are cases where this lint will require the wrong thing. For example here:
browser-compat-data/api/Element.json
Lines 4501 to 4517 in 445710d
"firefox": [ | |
{ | |
"version_added": "34" | |
}, | |
{ | |
"version_added": "44", | |
"alternative_name": "webkitMatchesSelector" | |
}, | |
{ | |
"version_added": "3.6", | |
"alternative_name": "mozMatchesSelector", | |
"notes": [ | |
"Before Firefox 4, invalid selector strings caused false to be returned instead of throwing an exception.", | |
"See <a href='https://bugzil.la/1119718'>bug 1119718</a> for removal." | |
] | |
} | |
], |
The webkitMatchesSelector
entry is the newest, but we don't want it to be the first one listed. Or maybe we should want that, but then we need to change the rendering rules of MDN, since that will use the first entry.
Hmm, now that I'm less active here, I'll drop this in favor of #5352. |
A checklist to help your pull request get merged faster:
Fixes #1596