-
Notifications
You must be signed in to change notification settings - Fork 522
Update color literals #647
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
Merged
bgriffith
merged 11 commits into
sasstools:develop
from
DanPurdy:feature/fix-color-literals
Apr 27, 2016
Merged
Update color literals #647
bgriffith
merged 11 commits into
sasstools:develop
from
DanPurdy:feature/fix-color-literals
Apr 27, 2016
Conversation
This file contains hidden or 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
Due to the extra features contained in this we should probably hold it for 1.7.0 There's a few fixes we could roll out already as 1.6.3 |
* @returns {String} Either a '#' or an empty string | ||
*/ | ||
var checkHexPrefix = function (nodeType) { | ||
var prefix = nodeType === 'color' ? '#' : ''; |
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.
Could be simplified with;
return nodeType === 'color' ? '#' : '';
a0fac8b
to
b498d80
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Carrying on from the changes proposed in #539 I've gone back and had a quick review of the rule.
Added two extra options
allow-variable-identifiers
(defaulttrue
)allow-map-identifiers
(defaulttrue
)The first option allows you to disallow the use of color-literals as variable identifiers/names but is disabled by default due to the feedback we received around this rule.
The second option allows you to disallow the use of color literals as map identifiers which to me seemed the logical extension of the option above but suited different use cases to the above.
Added extra tests and necessary documentation
closes #538
closes #539
DCO 1.1 Signed-off-by: Dan Purdy <dan@danpurdy.co.uk>