sass / linter

An experimental Sass linter written using the Dart Sass AST
MIT License
39 stars 6 forks source link

Add a lint rule for standalone script interpolation #14

Open nex3 opened 6 years ago

nex3 commented 6 years ago

Because interpolation is necessary to include SassScript values in many contexts, users sometimes accidentally use it in SassScript expressions themselves. For example, see this line from Angular's Material Design components. Not only is this unnecessary, it coerces the result of the expression to an unquoted string, which may make it fail with further mathematical operations down the line.

There should be a lint for this. Specifically, if an interpolated identifier that's just a single interpolation with no other text is encountered, the linter should suggest the user replace it with the value of the expression.