8000 Update color literals by DanPurdy · Pull Request #647 · sasstools/sass-lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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
merged 11 commits into from
Apr 27, 2016
Merged

Conversation

DanPurdy
Copy link
Member

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 (default true)
  • allow-map-identifiers (default true)

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>

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling a0fac8b on DanPurdy:feature/fix-color-literals into 6b04147 on sasstools:develop.

@DanPurdy DanPurdy changed the title Fix color literals Update color literals Apr 26, 2016
@DanPurdy DanPurdy added this to the 1.7.0 milestone Apr 26, 2016
@DanPurdy
Copy link
Member Author

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' ? '#' : '';
Copy link
Member

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' ? '#' : '';

@DanPurdy DanPurdy force-pushed the feature/fix-color-literals branch from a0fac8b to b498d80 Compare April 26, 2016 22:30
@coveralls
Copy link
coveralls commented Apr 26, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling b498d80 on DanPurdy:feature/fix-color-literals into f745ab5 on sasstools:develop.

@coveralls
Copy link
coveralls commented Apr 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling 4035568 on DanPurdy:feature/fix-color-literals into bbef921 on sasstools:develop.

@coveralls
Copy link
coveralls commented Apr 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling a5e713f on DanPurdy:feature/fix-color-literals into 557b977 on sasstools:develop.

@coveralls
Copy link
coveralls commented Apr 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling 57fa746 on DanPurdy:feature/fix-color-literals into 90bf83b on sasstools:develop.

@coveralls
Copy link
coveralls commented Apr 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling 6a2f374 on DanPurdy:feature/fix-color-literals into 0fb7d3d on sasstools:develop.

@coveralls
Copy link
coveralls commented Apr 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.017% when pulling fe71aac on DanPurdy:feature/fix-color-literals into 0fb7d3d on sasstools:develop.

@bgriffith bgriffith merged commit cfccd09 into sasstools:develop Apr 27, 2016
@DanPurdy DanPurdy deleted the feature/fix-color-literals branch May 5, 2016 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No color literals raises warning on variable in map
4 participants
0