CSSLint / csslint

Automated linting of Cascading Stylesheets
http://csslint.net
Other
4.76k stars 484 forks source link

bug(rule): unique-headings not ignored #759

Open Kristinita opened 4 years ago

Kristinita commented 4 years ago

1. Summary

I couldn't ignore unique-headings rule, use ignoring parts of CSS during linting.

I don't reproduce this issue for another CSSLint rules.

2. Environment

3. Data

/* csslint ignore:start */

h1,
.SashaFirstClass {
    font-family: sans-serif
}

h1,
.SashaSecondClass {
    font-style: italic
}

/* csslint ignore:end */

4. Steps to reproduce

csslint KiraIgnoreHeadings.css

I reproduce the problem for CSSLint online.

5. Expected behavior

No errors and/or warnings.

6. Actual behavior

csslint: There is 1 problem in D:\SashaDebugging\KiraCSSLint\KiraIgnoreHeadings.css.

KiraIgnoreHeadings.css
1: warning
You have 2 h1s defined in this stylesheet.

7. Not helped

  1. I can't use ignoring rules per line, because I use Stylus → I can't preserve comment on specific line after Stylus to CSS compilation.
  2. peterorum answer doesn't work for me, see my comment.

8. Don't offer

8.1. “You don't need to ignore this option”

Please, read #80. I agree with users @trygve-lie and @Nateowami.

Thanks.