Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alias *-whitelist, *-blacklist and *-requirelist rules
Previously *-whitelist, *-blacklist and *-requirelist rules were renamed to a consistent naming pattern of *-allowed-list, *-disallowed-list and *-required-list respectively. This commit adds aliases so that the old rules can continue to operate; this allows backwards compatibility to be maintained. A consequence of this is that violations for the previously named rules will show up with the new name. A developer may also get some confusing results if they happen to have the same rule defined with both names and different options.
- Loading branch information
Showing
31 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict'; | ||
|
||
const rules = require('../rules'); | ||
|
||
const whitelistAndBlacklistRulePrefixes = [ | ||
'at-rule', | ||
'declaration-property-unit', | ||
'declaration-property-value', | ||
'function', | ||
'function-url-scheme', | ||
'media-feature-name', | ||
'property', | ||
'selector-attribute-operator', | ||
'selector-combinator', | ||
'selector-pseudo-class', | ||
'selector-pseudo-element', | ||
'unit', | ||
]; | ||
|
||
const whitelistRulePrefixes = whitelistAndBlacklistRulePrefixes.concat([ | ||
'media-feature-name-value', | ||
]); | ||
|
||
whitelistRulePrefixes.forEach((prefix) => { | ||
it(`aliases ${prefix}-whitelist to ${prefix}-allowed-list`, () => | ||
expect(rules[`${prefix}-whitelist`].ruleName).toEqual(`${prefix}-allowed-list`)); | ||
}); | ||
|
||
const blacklistRulePrefixes = whitelistAndBlacklistRulePrefixes.concat(['comment-word']); | ||
|
||
blacklistRulePrefixes.forEach((prefix) => { | ||
it(`aliases ${prefix}-blacklist to ${prefix}-disallowed-list`, () => | ||
expect(rules[`${prefix}-blacklist`].ruleName).toEqual(`${prefix}-disallowed-list`)); | ||
}); | ||
|
||
const requirelistRulePrefixes = ['at-rule-property']; | ||
|
||
requirelistRulePrefixes.forEach((prefix) => { | ||
it(`aliases ${prefix}-requirelist to ${prefix}-required-list`, () => | ||
expect(rules[`${prefix}-requirelist`].ruleName).toEqual(`${prefix}-required-list`)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.