-
-
Notifications
You must be signed in to change notification settings - Fork 930
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
Error with scss nested property syntax #1386
Comments
Is |
I'm not a fan of doing this, but I believe it is: Compiles to:
|
Ah ok... It looks like it's an issue with postcss-selector-parser: postcss/postcss-selector-parser#64 |
yup, looks like the same issue, I'm not sure of the correct terminology for code like:
but it would be nice to have a rule, that would check for this, as I'd like to avoid it in the codebase I'm working on. |
or another suggestion, if possible, that would be useful, is if the error code stated the filename / line / character where the error occurred. |
Rule requests I'll leave to @davidtheclark or @jeddy3 to comment on. Although I think recently they're aiming to encourage community members to create stylelint plugins for rules that handle non-standard css syntax. |
ok, thanks for the feedback, yeah, appreciate this isn't a |
In case it helps anyone else that ends up here, there's an issue for this on Stack Overflow as well: |
At some point recently (6.4.0, I believe) we tried to catch errors thrown by It looks from your error like the stylehacks rule, |
In fact, this raises another issue with the use of stylehacks: Our internal utils would help us ignore nonstandard selectors like this (ending in a |
Looked into this some. Probably a huge pain, so I'm just going to suggest that you disable that rule for that line, and move on. If somebody finds this issue later and wants to really tackle the problem, go for it. |
For anyone wishing to tackle this upstream in
@s10wen That's a great suggestion for the @s10wen As an aside, one of the advantages of crafting your own CSS Processor with PostCSS is that you don't need to rely on linting to disallow language features. Instead, you simply don't use the |
@jeddy3 cheers, done stylelint-scss/stylelint-scss#44 For anyone else who happens to end up here, another solution is to simply update the code: Before:
After:
I personally much prefer the |
Hey guys, There is a discussion right now in a PR to postcss-scss about supporting nested properties. I believe stylelint would benefit from that as well, so I'd really like to hear your opinions on how exactly this should be implemented. As a breif intro into the discussion: at the moment nested props groups are treated as Rules and are not distinguished at all. The options are 1) Adding properties to such Rule objects (like Any thoughts are welcome in the PR thread. Thanks! |
I think probably the easiest thing for stylelint would be if the nested declarations were exploded into a set of regular declaration nodes with selectors matching what the compiled selector should be. No idea if that's good for other tools, though! |
@davidtheclark thanks for your comment! would you mind leaving one in the PR thread? The thing is I agree that it should be a Declaration being extended, and the author doesn't, so I was hoping other devs could give some pros or cons from their points of view. As for the scheme you described: wouldn't it mess |
With the following code (using
gulp-stylelint
andsyntax: 'scss'
):I get the error:
Wondering if anyone can point me in the right direction, of why this might be happening.
The text was updated successfully, but these errors were encountered: