pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

disallowSpaceAfterCodeOperator and variable declaration #56

Closed samuelmartineau closed 8 years ago

samuelmartineau commented 8 years ago

Hi @benedfit ,

First of all, thank you for this linter which help us to maintain the quality of our code :smile: We have encountered an issue (or may be just a config problem) with the rule disallowSpaceAfterCodeOperator

- var authenticated = true
body(class=authenticated ? 'authed' : 'anon')

Unwanted space after code operator

So is there a way to allow spaces (before & after) for variable declaraiton and keep the disallowSpaceAfterCodeOperator's behavior for tag+operator ?

Thk

benedfit commented 8 years ago

Thanks, I'll take a look at this

benedfit commented 8 years ago

Hi @samuelmartineau currently disallowSpaceAfterCodeOperator applies the same validation rules to buffered (-), unbuffered (=), and unescaped buffered (!=) code operators.

I'll add this to the list of improvements so that each can be handle separately if desired.

For the time being you'll have to lose the space before variable declarations

samuelmartineau commented 8 years ago

Thank you @benedfit for the ETA, I will keep a close eye on it.

benedfit commented 8 years ago

@samuelmartineau this is now available in v2.1.9: