Closed aeosynth closed 7 years ago
Thank you for your interest. Those options may be a little confusing, but they serve different purposes, and I don't think merging them will help to understand. html/report-bad-indent
is useful with or without html/indent
:
html/indent
isn't specified, the parser will use the indentation of the first line of code for the rest of the <script>
tag. So if another line is underindented, it will be considered as badly indented and reported if the html/report-bad-indent
is true.As for "just" making a rule instead: those settings are used by the parser, way before any rule is triggered. They must be used this way so rules as indent
are working out of the box, without having to know if the HTML was indented etc. (rules are executing on pure JS, no HTML code anyway)
Let me know if you think of a better way to document it!
would it be possible to check for the existence of an
html/indent
setting, and if so automatically enablehtml/report-bad-indent
? imo the indent setting should exist only to change the severity, not to enable the feature.edit: or combine the two, eg
html/indent: [2, 0]
edit: just make it a rule instead of a setting