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

New lint failures from the proposed 0.3.0 code #28

Closed
jedrichards opened this issue Mar 29, 2015 · 7 comments
Closed

New lint failures from the proposed 0.3.0 code #28

jedrichards opened this issue Mar 29, 2015 · 7 comments

Comments

@jedrichards
Copy link

I just ran my project through the new linter based off the current state of the master branch before the proposed bump to 0.3.0 (as of 4cb6db8) and I'm getting a few new lint failures that I wasn't getting with 0.2.0.

Specifically the following selectors are all producing new failures where they weren't before,

.AuthCodeControl-input[type=number]
.Button[disabled]
.CheckControl-input[disabled] ~ .CheckControl-label
.TextControl-inner--password .TextControl-input[type="password"]

Are these selectors actually non-compliant and the new linting code properly picking them up, or is something going awry?

I'm just calling the linter with no additional options, like so,

postcss()
  .use(require('postcss-bem-linter')())
  .process(css);
@davidtheclark
Copy link
Contributor

The errors make sense to me, because those chained attribute selectors are not accounted for in the SUIT regular expression.

I believe that before the recent changes the regular expressions were not checking that the whole sequence matched the whole regexp. Instead, I think they were looking to see if the regexp had a match anywhere within the selector sequence. I switched it to the current more strict form (whole match) because otherwise you could actually attach anything arbitrarily after or before a matching string.

(I hope that statement is accurate --- I'd have to take a look at the old code to verify. Please correct me if I'm wrong @necolas.)

Anyway, @necolas do you want the SUIT componentSelector pattern to allow for attribute selectors? If so, you or I could update the regexp.

@jedrichards
Copy link
Author

Also getting new errors on these two selectors as well,

.ActivityLog-detailQuote ::before
.ListItem-media--double *:nth-child(2)

@davidtheclark
Copy link
Contributor

Again, I think the regexps are performing as expected. Those will probably work in 'loose mode', though. I think it's up to @necolas whether to allow that kind of stuff with the SUIT pattern.

@necolas
Copy link
Contributor

necolas commented Apr 1, 2015

we should support the chained attributes

this should be an error though, because it could impact every element in the sub-tree

.ActivityLog-detailQuote ::before {}
.ListItem-media--double *:nth-child(2) {}

@davidtheclark
Copy link
Contributor

#30 is there for adding chained attributes to SUIT pattern, which will solve this problem.

@necolas
Copy link
Contributor

necolas commented Apr 25, 2015

Fixed by #35

@necolas necolas closed this as completed Apr 25, 2015
@jedrichards
Copy link
Author

👍 Thanks so much guys, looking forward to the new release.

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

No branches or pull requests

3 participants