urlQuotes throwing warning for LESS variable
See original GitHub issueWhich version of lesshint
are you using?
3.1.0
How are you running lesshint
? CLI, Node.js API, Grunt/Gulp plugin?
Gulp
What’s your .lesshintrc
configuration?
{
"fileExtensions": [".less"],
"spaceAfterPropertyColon": {
"enabled": true,
"style": "one_space" // Comments are allowed
},
"propertyOrdering": {
"enabled": false
},
"maxCharPerLine": {
"enabled": false
}
}
If you’re reporting a bug, please show us some code that’s failing.
@brand-logo: '/assets/images/logo.svg';
.head-logo {
background: url(@brand-logo);
}
What did you expect to happen? No warning. The variable evaluates to a properly quoted url.
What’s the actual result?
I get this warning: urlQuotes: URLs should be enclosed in quotes
Technically, I could write the background declaration as background: url('@{brand-logo}');
to prevent the warning, but it feels weird to add unnecessary interpolation just to make the linter happy. Thoughts?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why is ESLint throwing warning about unused variable that's ...
By "using it", ESLint is referring to actually putting it to some use. Simply putting a value in it does not constitute using...
Read more >MariaDB User Define Variable throws warning if it is empty
My question is: Is there any possible way to check whether the user-defined variable contains no result, and then directly return "0 results ......
Read more >Multiple Imputation Warning that model contains more than ...
However, all I get is a table of titled Warnings: The imputation model for [variable] contains more than 100 parameters.
Read more >Changelog | Stylelint
Fixed: throwing more informative error when all input files are ignored (#5709). ... Fixed: length-zero-no-unit false positives for Less variables (#4405).
Read more >Throw a warning if we are declaring a variable with const and ...
While defining a variable in #Svelte, make sure to use let/var and not const, otherwise those bindings won't work, as it can't be...
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
Thanks for the extra examples!
I agree that a URL without a slash seems unlikely, and we can never be sure of what the variable actually contains. I still think just ignoring variables in
url()
is fine (FWIW I checked other linters and they do it too).A PR would be highly appreciated! Let us know if you need anything.
Closed in #366.