Closed nex3 closed 6 years ago
Do you mean checking usages of map-get
, or map creation, or both?
Also, do these examples match your expectations?
$theme: (primary: #f00, secondary: #00f); // linter error
$theme: ('primary': #f00, 'secondary': #00f); // ok
$theme: ("primary": #f00, "secondary": #00f); // ok
map-get($theme, primary); // linter error
map-get($theme, 'primary'); // ok
Do you mean checking usages of
map-get
, or map creation, or both?
Just map creation.
It's generally a bad practice to use unquoted strings as map keys. Some tokens (like
green
) parse as colors rather than strings, which means that if the keys are used in selector names, they won't necessarily emit as text (for example,green
is emitted as#0f0
in compressed mode). It would be good to have a lint that encourages users to quote their map keys.