You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...scss-lint will incorrectly report lints for each keyword argument.
This is caused by the Sass parser (as of 3.2.9) normalizing the keyword arguments to their underscore-ized form when building the parse tree.
There are two possible solutions:
Monkey-patch Sass::Script::Variable#underscored_name to return the original name.
Fixes the problem and is quick to implement, but will break Sass compiling (not a problem since scss-lint doesn't compile SCSS for any of its lints...yet)
Introduces another bug where if a user calls a function with two variables that are the same except they differ in hyphen and underscore, e.g. func($line-height: 1, $line_height: 1) the parser won't report an error. Probably ok, as this is an extreme edge case.
Still sucks since we're monkey-patching rather than contributing upstream
Contribute an upstream fix to sass to change the keywords attribute of Funcall and MixinNode nodes so that it isn't a hash of String => Sass::Script::Node, but something that preserves the original name of the variable, like Sass::Script::Variable => Sass::Script::Node.
More complex to implement, forces us to change dependency from official sass gem to fork until it is merged upstream (and there is a chance it may not be merged upstream).
Will investigate when more time permits.
The text was updated successfully, but these errors were encountered:
When passing keyword arguments to a function or mixin, e.g.
...
scss-lint
will incorrectly report lints for each keyword argument.This is caused by the Sass parser (as of 3.2.9) normalizing the keyword arguments to their underscore-ized form when building the parse tree.
There are two possible solutions:
Sass::Script::Variable#underscored_name
to return the originalname
.scss-lint
doesn't compile SCSS for any of its lints...yet)func($line-height: 1, $line_height: 1)
the parser won't report an error. Probably ok, as this is an extreme edge case.sass
to change thekeywords
attribute ofFuncall
andMixinNode
nodes so that it isn't a hash ofString => Sass::Script::Node
, but something that preserves the original name of the variable, likeSass::Script::Variable => Sass::Script::Node
.sass
gem to fork until it is merged upstream (and there is a chance it may not be merged upstream).Will investigate when more time permits.
The text was updated successfully, but these errors were encountered: