New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more rules #3
Comments
A couple of suggestions for useful rules
//- invalid
- var n = 0;
- while (n < 10)
- n++
li= n Pretty much all uses for doing this have builtins that can replace them, and it makes it very hard to provide useful line numbers in errors. If you force all lines starting with //- valid
- var n = 0;
while (n < 10)
- n++
li= n |
@ForbesLindesay thanks for your thoughts. It's interesting to here that attribute interpolation is considered for deprecation, as our internal style preference was leaning towards it, is this the plan for all string interpolation? |
May I ask why are you thinking of deprecating interpolation? I love using it, just like string substitution the template strings in ES6/ES2015, so I'd hate to see it go :). |
@kevin-smets pugjs/pug#2095 details the reasoning, and in Jade 2, attribute interpolation will be deprecated. I'm still leaving the tests for it in place for now, but have changed the Clock preset to disallow them by default |
This rule reports lines in Pug file that exceed the specified length. Related to pugjs#3
Definite:
"CR"
,"LF"
,"CRLF"
(blah='blah')
class=['a', 'b']
class={active: true }
Suggestions:
quotation marksno whitespace between attribute pairsblock expansionid as literal/attributerequire space after buffered codeno duplicate attributes or attribute blocksallow html in jadeno divsclasses proceed attributestag interpolation ???prefer variable interpolationline feed at end of filedon't use class attribute when literal will doline length of attributesrequirevar
no unnecessary closing tagsremove redundant whitespacerequired attributes for certain tags (e.g. img must have alt)disallow certain tagsvalidate boolean attributesstyle attributes use JSON (formatting rules for these)class attributes Array and/or JSON (formatting rules for these)multi-line unbuffered code formatno unnecessary string interpolation (e.g. h1 #{thing} should be h1= thing)no unnecessary string concat (e.g. h1= thing + 'blah' should be h1 #{thing} blah)The text was updated successfully, but these errors were encountered: