Open abdonrd opened 7 years ago
@abdonrd You enabled a parser for HTML files so any CSS in there could be linted by stylelint
, then you asked it to lint a file that has no CSS, and have now filed an issue when it complained there was no CSS in the file? It sounds like it is working exactly as it should to me.
To clarify a little bit, if you don't want to see this warning change the stylelint
section of your package.json
to look like this:
{
"extends": "stylelint-config-standard",
"processors": ["stylelint-processor-html"],
"rules": {
"no-empty-source": null
}
}
This will disable the rule that is giving this error.
Thanks for the quick response, @Arcanemagus!
@abdonrd You enabled a parser for HTML files so any CSS in there could be linted by stylelint, then you asked it to lint a file that has no CSS, and have now filed an issue when it complained there was no CSS in the file? It sounds like it is working exactly as it should to me.
In my projects I have a lot .html
files. Some of them have CSS and others don't.
I think the processor should only analyze the CSS code, if it finds one.
To clarify a little bit, if you don't want to see this warning change the
stylelint
section of yourpackage.json
to look like this:{ "extends": "stylelint-config-standard", "processors": ["stylelint-processor-html"], "rules": { "no-empty-source": null } }
This will disable the rule that is giving this error.
I would like keep the no-empty-source
rule, because I want to avoid the empty .css
files or the empty <style>
tags in the .html
files.
I encountered the same thing as @abdonrd. In my use-case, if there is no <style>
tag I'm OK with that, but if there is an empty <style>
tag or an empty .css file then I'd want to be alerted on that.
I'm doing the "no-empty-source": null
for now, just wanted to cast my vote for this change.
@ccbikai 我觉得楼上说得都很有道理,大佬不准备更新一下了么。。 I think the upstairs is very reasonable, the big guy is not ready to update it?
I think the process should only analyze the CSS code, and in this example I don't have any CSS code.