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

Valid attribute selectors flagged as invalid properties #54

Closed
justsee opened this issue Mar 17, 2015 · 7 comments
Closed

Valid attribute selectors flagged as invalid properties #54

justsee opened this issue Mar 17, 2015 · 7 comments
Labels
Milestone

Comments

@justsee
Copy link
Contributor

justsee commented Mar 17, 2015

It seems attribute presence and value selectors are being flagged as invalid properties. For instance:

a[href]
  outline: none;

when run through stylint generates:

Warning:  property is not valid
File: test.styl
Line: 1: a[href]
@awayken
Copy link
Contributor

awayken commented Mar 17, 2015

I see this, too, when valid: true.

I don't see any issue if I do this:

a[href] {
  outline: none;
}

@rossPatton rossPatton added the bug label Mar 17, 2015
@rossPatton rossPatton modified the milestone: 0.9.3 Mar 21, 2015
@rossPatton
Copy link
Collaborator

this should be fixed on the develop branch, please verify

@awayken
Copy link
Contributor

awayken commented Mar 23, 2015

This worked for me, but I ran into another weird bug. If my a[href] declaration came at the top of my Stylus file, then I get the following error:

D:\Sites\stylint\src\checks\duplicates.js:69
                        this.prevLine.indexOf(',') === -1 ) {
                                     ^
TypeError: Cannot read property 'indexOf' of undefined
    at Object.duplicateSelectors [as duplicates] (D:\Sites\stylint\src\checks\duplicates.js:69:17)
    at Object.test (D:\Sites\stylint\src\test.js:118:14)
    at D:\Sites\stylint\src\parse.js:50:15
    at Array.forEach (native)
    at D:\Sites\stylint\src\parse.js:46:9
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:379:3)

Let me know if you'd like me to create a separate bug report for this.

@rossPatton
Copy link
Collaborator

hah, that makes sense, and the fix should be easy actually. i just need something like lineNum > 0 before i do that check

@rossPatton
Copy link
Collaborator

should be fixed in 0.9.3

@awayken
Copy link
Contributor

awayken commented Mar 24, 2015

👍 No longer throws an error when I pull develop.

@rossPatton
Copy link
Collaborator

awesome

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

3 participants