Open GPetrites opened 6 years ago
I just did a test and confirm what you experience. A new option would be great, for instance:
"validateAttributeSeparator": {
"separator": ", ",
"allowMultiLine": true # `allowMultiLine` and `multiLineSeparator` should be mutually exclusive
}
Contributions are welcome!
This rule is probably the most important for us. When you use Angular you eventually learn that Pug doesn't recognize the Angular binding attributes correctly unless you separate them with a comma. Missing a comma has bitten us numerous times.
currently when you configure the rule using:
The pug is only considered valid if the white space on the second line matches EXACTLY the white space included in the rule. As I have it above, there are two spaces after the newline so the rule only passed if the pug looks like:
Note that there are exactly two spaces before the 'bbb' attribute. If I add or remove a space, the rule reports it as an error.
If I replace the spaces with tabs in both the rule and the pug, I get the same results. The number of tabs in the rule must match exactly the number of tabs in the pug.
As a result, it's not possible to create a rule that allows the following pug to be recognized as valid:
In order to be usable, the multiLineSeparator needs to support various levels of indenting on the following line.