sass / linter

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

Properly visit FunctionExpression; handle ArgumentInvocation #29

Closed srawlins closed 5 years ago

srawlins commented 5 years ago

Also refactor rule tests.

FunctionExpression is needed for upcoming rule for #24. Implementing it and visiting the ArgumentInvocation makes other rules more complete.

The tests were using a single _DummyRule that caught numbers and booleans, to test whether Rule indeed visited down the tree and reported back up. However, to test all of the components of an ArgumentInvocation, I wanted to also report on variables. This spurred a whole refactoring of these tests, better isolating what is being tested (before, I had to be careful about placing numbers and booleans in the same Sass script; this refactoring improves the expectation on line 233).