slim-lint icon indicating copy to clipboard operation
slim-lint copied to clipboard

Does it make sense to add a Slim syntax validity check?

Open yjukaku opened this issue 4 years ago • 1 comments

I wonder if checking if a Slim file has valid Slim syntax would make sense as part of this linting tool. WDYT @sds ?

I just ran into an issue with a file with markup like this, which "passes" slim-lint but is not valid Slim:

' Hello. This is some simple math:
= 1 + 1 # this equals 2 

The trailing Ruby style comment is actually not valid, and I always forget that.

The slim-lint check passed in our CI build, and we didn't happen to have a feature or view test for this file, so something like this got into our master branch. 😬

Would it make sense for slim-lint to run the slimrb command from the slim gem and fail the linting process if the file is not valid Slim?

yjukaku avatar Sep 21 '21 18:09 yjukaku

Sorry for the delay in response. Supportive of a PR that adds the additional check!

sds avatar Feb 23 '22 06:02 sds