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

False positives for "colons": "always" when nesting #181

Closed
futekov opened this issue Aug 9, 2015 · 9 comments
Closed

False positives for "colons": "always" when nesting #181

futekov opened this issue Aug 9, 2015 · 9 comments
Labels

Comments

@futekov
Copy link
Contributor

futekov commented Aug 9, 2015

I discovered several false positives for "colons": "always" when nesting, this code produces 5 errors - one for each root class:

.ExtendBug
  @extend .List
  margin: 15px

.ParentReferenceBug
  max-width: 100px
  .ie9 &
    max-width: 80px

.ChildBug1
  .parent > .child
    float: left

.ChildBug2
  > .child
    padding: 4px

.ChildBug3
  .parent .child
    margin-left: 0

The errors:

  line 2:   missing colon between property and value
  line 6:   missing colon between property and value
  line 11:  missing colon between property and value
  line 15:  missing colon between property and value
  line 19:  missing colon between property and value

My config:

{
    "blocks": false,
    "brackets": "never",
    "colons": "always",
    "colors": false,
    "commaSpace": "always",
    "commentSpace": "always",
    "cssLiteral": false,
    "depthLimit": 4,
    "duplicates": true,
    "efficient": "always",
    "extendPref": "@extend",
    "globalDupe": true,
    "indentPref": 2,
    "leadingZero": "always",
    "maxErrors": false,
    "maxWarnings": false,
    "mixed": false,
    "namingConvention": false,
    "namingConventionStrict": false,
    "none": "always",
    "parenSpace": "never",
    "placeholders": false,
    "prefixVarsWithDollar": "always",
    "reporter": "stylint-stylish",
    "quotePref": false,
    "stackedProperties": "never",
    "semicolons": "never",
    "sortOrder": false,
    "universal": "never",
    "valid": true,
    "whitespace": true,
    "zeroUnits": false,
    "zIndexNormalize": false
}
@rossPatton rossPatton added the bug label Aug 10, 2015
@langdonx
Copy link

Having the same issue.. the issue exists with brackets: "always" as well...

Warning: always use brackets when defining selectors
File: index.styl
Line: 52: @extend $anchor;

For:

a {
    @extend $anchor;
}

@rossPatton
Copy link
Collaborator

Are you both using the latest version?

@langdonx
Copy link

Yes, installed it yesterday.

Stylint version: 1.1.3

@futekov
Copy link
Contributor Author

futekov commented Aug 21, 2015

Yup, logged the bug when it was 1.1.1, it's still reproducable on 1.1.3.

@rossPatton
Copy link
Collaborator

k just checking. i'll take a look this weekend.

rossPatton pushed a commit that referenced this issue Aug 23, 2015
@rossPatton
Copy link
Collaborator

@futekov @langdonx Can you guys let me know if you still see this issue in 1.2.0?

@langdonx
Copy link

Yes, fixed in 1.2.2. Getting a different error now, but will file a separate issue.

@futekov
Copy link
Contributor Author

futekov commented Aug 24, 2015

I can confirm that since 1.2.2 the issue is fixed.

@futekov futekov closed this as completed Aug 24, 2015
@Dylan-Chapman
Copy link

I think this may still be a problem. If, for example, you have the following:

// select all direct children of .ChildBug
.ChildBug
  > *
    padding: 4px

You'll get the error:

line 2:  missing colon between property and value

Can anybody confirm this? I'm using gulp-stylint, which is using stylint 1.2.3

I can create a separate issue if it's still a problem in the newest version of stylint, but I wanted to verify first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants