Closed mtbradle-ge closed 7 years ago
Thank you for the report. This code in TransformableString
is actually here to ignore messages for lints located inside the removed HTML parts. I am planning to change how this plugin works for the next major version: HTML parts won't be replaced by anything, instead script tags will be linted independently. This should resolve this kind of issue altogether.
For now, I added your test case to the test suit, so I won't miss it for the next version!
I released a beta version of eslint-plugin-html
, you can test it with npm install eslint-plugin-html@next
. I'll release a final version after eslint 4
is released.
Changes are listed here.
When the position that the rule is broken occurs at the very beginning of a script tag, the error does not seem to be reported.
Here is a bare minimum repository that can reproduce the issue:
https://github.com/mtbradle-ge/eslint-plugin-html-max-lines-bug
Just clone and run
eslint . --ext .html
No errors are reported for the bug.html for max-lens or max-lines as specified in the config, even though they are clearly present.
This seems to be because line 84 of TransformableString.js:
Changing the return to a break seemed to mitigate the issue...?