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

`declaration-nested-properties: "always"` emits `Expected a pseudo-class or pseudo-element.` #359

Closed
JounQin opened this issue Aug 18, 2019 · 4 comments · Fixed by #360
Closed

Comments

@JounQin
Copy link

@JounQin JounQin commented Aug 18, 2019

a {
  font: {
    size: 10px;
    weight: 400;
  }
}

The error is from postcss-selector-parser

Error: Expected a pseudo-class or pseudo-element.
    at Root._error (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:160:16)
    at Root.error (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/selectors/root.js:43:19)
    at Parser.error (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:726:21)
    at Parser.expected (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:1113:19)
    at Parser.pseudo (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:861:19)
    at Parser.parse (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:1064:14)
    at Parser.loop (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:1023:12)
    at new Parser (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:150:10)
    at Processor._root (/Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/processor.js:55:18)
    at /Users/JounQin/Workspaces/GitHub/configs/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/processor.js:74:26
@JounQin JounQin changed the title `declaration-nested-properties-no-divided-groups: "always"` emits `Expected a pseudo-class or pseudo-element.` `declaration-nested-properties: "always"` emits `Expected a pseudo-class or pseudo-element.` Aug 18, 2019
@kristerkari

This comment has been minimized.

Copy link
Owner

@kristerkari kristerkari commented Aug 18, 2019

Thanks @JounQin !

I tried adding a unit test with the example that you gave, but it does not throw any error. Would you have some example to shere that throws the error?

@JounQin

This comment has been minimized.

Copy link
Author

@JounQin JounQin commented Aug 18, 2019

https://github.com/1stG/configs/blob/master/packages/stylelint-config/scss.js#L15

You can clone the repository and change this line, and then simply run yarn lint:style:scss

@kristerkari

This comment has been minimized.

Copy link
Owner

@kristerkari kristerkari commented Aug 19, 2019

Thanks @JounQin! The error is actually coming from the selector-nest-combinators rule. I managed to reproduce the error with a unit test, so I'll prepare a fix for that rule.

@JounQin

This comment has been minimized.

Copy link
Author

@JounQin JounQin commented Aug 19, 2019

Thanks for your quick response and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.