Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false negatives for ignore: ["inside-block"] in rule-empty-line-before #2891

Closed
gucong3000 opened this issue Sep 14, 2017 · 5 comments
Closed
Labels
status: wip is being worked on by someone syntax: html relates to HTML style tags and attributes type: bug a problem with a feature or rule

Comments

@gucong3000
Copy link
Member

gucong3000 commented Sep 14, 2017

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

Cannot monitor the missing blank line before rule in HTML.

Which rule, if any, is this issue related to?

rule-empty-line-before

What CSS is needed to reproduce this issue?

<style>
.foo {
  color: pink;
}
.bar {
  color: pink;
}
</style>

What stylelint configuration is needed to reproduce this issue?

{
  "rules": {
    "rule-empty-line-before": ["always", {
      "ignore": "inside-block"
    }]
  }
}

Which version of stylelint are you using?

8.1.1

How are you running stylelint: CLI, PostCSS plugin, Node API?

CLI

stylelint "**/*.html" --custom-syntax postcss-html

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

standard syntax in HTML.

What did you expect to happen?

The following warnings were flagged in line that .bar {

What actually happened (e.g. what warnings or errors you are getting)?

No warnings to be flagged.

@gucong3000
Copy link
Member Author

gucong3000 commented Sep 14, 2017

@jeddy3
Maybe we need a new label. non-standard syntax: html or some other description.

@gucong3000 gucong3000 added the status: wip is being worked on by someone label Sep 14, 2017
@jeddy3 jeddy3 changed the title rule-empty-line-before false for CSS in HTML with ignore: "inside-block" Fix false positives CSS in HTML for with ignore: ["inside-block"] in rule-empty-line-before Sep 14, 2017
@alexander-akait
Copy link
Member

@gucong3000 non-standard syntax: html is misleading, because css in style tag is standard syntax. Maybe processor: html

@jeddy3 jeddy3 changed the title Fix false positives CSS in HTML for with ignore: ["inside-block"] in rule-empty-line-before Fix false positives for ignore: ["inside-block"] in rule-empty-line-before Sep 14, 2017
@jeddy3 jeddy3 added the syntax: html relates to HTML style tags and attributes label Sep 14, 2017
@jeddy3
Copy link
Member

jeddy3 commented Sep 14, 2017

Maybe we need a new label. non-standard syntax: html or some other description.

Done.

because css in style tag is standard syntax. Maybe processor: html

Ummm. Good point.

postcss-html is being used via the --custom-syntax option, right?:

stylelint "**/*.html" --custom-syntax postcss-html

What's the relationship/differences between postcss-html and the html processor?

@gucong3000
Copy link
Member Author

gucong3000 commented Sep 14, 2017

postcss-html is being used via the --custom-syntax option, right?:

yes.

What's the relationship/differences between postcss-html and the html processor?

postcss-html can restore HTML files from AST. This means postcss-html compatible with that the feature of stylelint - autofixing.

Other processor of stylelint don't compatible with autofixing

@jeddy3
Copy link
Member

jeddy3 commented Sep 14, 2017

postcss-html can restore HTML files from AST. This means postcss-html compatible with that the feature of stylelint - autofixing.

Thanks for explaining that. And am I right in thinking that not being able to do that is a current limitation of the processes? If so, is this a limitation that can be overcome?

gucong3000 added a commit that referenced this issue Sep 14, 2017
@gucong3000 gucong3000 changed the title Fix false positives for ignore: ["inside-block"] in rule-empty-line-before Fix missed warnings for ignore: ["inside-block"] in rule-empty-line-before Sep 15, 2017
@jeddy3 jeddy3 changed the title Fix missed warnings for ignore: ["inside-block"] in rule-empty-line-before Fix false negatives for ignore: ["inside-block"] in rule-empty-line-before Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone syntax: html relates to HTML style tags and attributes type: bug a problem with a feature or rule
Development

No branches or pull requests

3 participants