Skip to content

Commit

Permalink
Lint for version_added being the same as version_removed (#9610)
Browse files Browse the repository at this point in the history
Whether the versions are null, boolean or strings, this doesn't
communicate a lot of information.
  • Loading branch information
foolip authored Apr 29, 2021
1 parent bfdcb77 commit afd1926
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/linter/test-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ function checkVersions(supportData, relPath, logger) {
chalk`{red → {bold ${relPath}} - {bold version_removed: "${statement.version_removed}"} is {bold NOT} a valid version number for {bold ${browser}}\n Valid {bold ${browser}} versions are: ${validBrowserVersionsString}}`,
);
}
if ('version_removed' in statement && 'version_added' in statement) {
if ('version_added' in statement && 'version_removed' in statement) {
if (statement.version_added === statement.version_removed) {
logger.error(
chalk`{red → {bold ${relPath}} - {bold version_added: "${statement.version_added}"} must not be the same as {bold version_removed} for {bold ${browser}}}`,
);
}
if (
typeof statement.version_added !== 'string' &&
statement.version_added !== true
Expand Down

0 comments on commit afd1926

Please sign in to comment.