Value Exclusions for VariableValue rule.
See original GitHub issueWhich version of lesshint
are you using?
Latest
How are you running lesshint
? CLI, Node.js API, Grunt/Gulp plugin?
Gulp
What’s your .lesshintrc
configuration?
{
"fileExtensions": [".less", ".css"],
"excludedFiles": ["vendor.less"],
"attributeQuotes": false,
"borderZero": {
"style": "zero"
},
"decimalZero": {
"style": "none"
},
"depthLevel": true,
"duplicateProperty": {
"exclude": ["display", "background-image", "background-color", "src"] // Fallbacks
},
"finalNewline": true,
"hexLength": false,
"hexNotation": {
"style": "lowercase"
},
"hexValidation": true,
"idSelector": {
"exclude": ["#gradient", "#nav-affix"]
},
"importantRule": false,
"importPath": {
"filenameExtension": false,
"leadingUnderscore": false,
"exclude": []
},
"maxCharPerLine": false,
"newlineAfterBlock": false,
"propertyOrdering": false,
"propertyUnits": {
"valid": ["px", "em", "rem"],
"invalid": ["pt", "rem", "vw", "vh"]
},
"qualifyingElement": {
"allowWithAttribute": true,
"allowWithClass": true, // Controversial
"allowWithId": false
},
"selectorNaming": {
"disallowUppercase": true,
"disallowDash": false,
"disallowUnderscore": true // May need to allow for SB mapping
},
"singleLinePerProperty": {
"allowSingleLineRules": true
},
"singleLinePerSelector": {
"style": "18f"
},
"spaceAfterPropertyColon": false,
"spaceAfterPropertyName": {
"style": "no_space"
},
"spaceAfterPropertyValue": {
"style": "no_space"
},
"spaceAroundComma": {
"allowNewline": false,
"style": "after"
},
"spaceAroundOperator": false,
"spaceBeforeBrace": {
"style": "one_space"
},
"spaceBetweenParens": {
"style": "no_space"
},
"stringQuotes": {
"style": "single"
},
"trailingSemicolon": true,
"trailingWhitespace": true,
"urlFormat": {
"style": "relative"
},
"universalSelector": false,
"urlQuotes": false,
"variableValue": {
"always": ["color", "font-size"]
},
"zeroUnit": {
"style": "no_unit"
}
}
What did you expect to happen?
You can list values which are accepted that don’t have to be variables.
Variables are great for consistency, but in the example of color
having to be variables, inherit
fails. I don’t think it’s correct to have to create and inherit variable.
"variableValue": {
"always": ["color", "font-size"],
"exclude": ["inherit", "none"]
},
Invalid
.foo {
color: #09F;
}
Valid
.foo {
color: @blue;
}
Valid (with inherit exclusion)
.foo {
color: inherit;
}
Would you be interested in submitting a PR for this issue? I could give it a go, if you guys agree it’s worthwhile
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Advanced tuning of asset reconciliation exclusion rules - IBM
You can tune the Asset Reconciliation Exclusion rules to refine the definition of deviating asset growth in one or more of the rules....
Read more >4.3 Variable consideration - Viewpoint – PwC
Variable consideration is common and takes various forms, including (but not limited to) price concessions, volume discounts, rebates, ...
Read more >SDTM Validation Rules - Pinnacle 21
Rule ID Publisher ID FDA PMDA 1511.6 PMDA 1810.3 PMDA Severity 3.1.2 3.1.3 3.2 3.3
CT2001 FDAB017 X X X Reject X X X...
Read more >Set Procedural Conditional Variable Template
This template defines a variable on the product instance. This variable's name is the rule name, and its value is evaluated after each...
Read more >[java] ShortVariable: Add property with list of exclusions #2393
Please describe. The rule ShortVariable says that variable names should be at least minimum (default: 3) characters. In general, that's great.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should go for a
exclude
/allowedValues
option (not sure about the name yet) but a PR would be more than welcome @jodiedoubleday!Seems like a good use case to me. My vote is for an
allowedValues
property to specify which values are also allowed.This then begs the question - should we nix
valueVariable
and move that into a linter which specifies what types of values can be applied to a property?