Closed klebba closed 8 years ago
That's a good idea, I'll work on this soon.
@klebba I rewrote pretty much everything and now it has two options, "html/indent"
and "html/report-bad-indent"
. Could you test it and tell me if it works in your use case? See the Settings section of the README.
@BenoitZugmeyer I gave it a try; it's not quite working for me yet. I have configured to use "+2" spaces but the linter does not complain for this snippet:
<script>
(function () {
var myvar;
})();
</script>
It does complain for this one:
<script>
(function () {
var myvar;
})();
</script>
I haven't tried many more cases yet
Thank you for trying this. I tried to reproduce without success. Could you make sure you have the latest master
version by running npm install git+https://github.com/BenoitZugmeyer/eslint-plugin-html
(maybe with -g
if you installed eslint globally), then:
git clone https://gist.github.com/BenoitZugmeyer/405d6299837300fe9efb report-bad-indent-test
cd report-bad-indent-test
eslint test.html
In my case I've got the following output:
/home/.../tmp/report-bad-indent-test/test.html
2:1 error Bad line indentation (html plugin)
4:1 error Bad line indentation (html plugin)
✖ 2 problems (2 errors, 0 warnings)
Ok, that does work -- the reason it was failing is that the Atom editor does not run the rule until you interact with the contents of the script tag. Not an issue with eslint-plugin-html
-- thanks!
Lot of Atom users today :grin: I'll make a release soon, probably tomorrow.
I want to enforce an indentation style of script tags:
vs.
Is this possible with eslint-plugin-html?
Thanks