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

Fix declaration-property-value-no-unknown false negatives for nested declarations #7062

Closed
romainmenke opened this issue Jul 9, 2023 · 1 comment · Fixed by #7079
Closed
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@romainmenke
Copy link
Member

romainmenke commented Jul 9, 2023

What minimal example or steps are needed to reproduce the bug?

.foo {
	color: 10px; /* has a warning */
	color: red;
}

.foo {
	@media (screen) {
		color: 10px; /* no warning */
		color: red;
	}
}

I added color: red to make sure there weren't any false positives.

What minimal configuration is needed to reproduce the bug?

{
  "rules": {
    "declaration-property-value-no-unknown": true
  }
}

How did you run Stylelint?

Demo

Which Stylelint-related dependencies are you using?

{
  "stylelint": "latest",
  "stylelint-config-standard": "latest"
}

What did you expect to happen?

I expected to see two errors.
One for each color: 10px;.

What actually happened?

Only one error was reported, for the regular, unnested rule.

Do you have a proposal to fix the bug?

No response

@romainmenke
Copy link
Member Author

I think this was intended to differentiate at rule descriptors from declarations.

Maybe we can use the list of allowed nested at rules : https://drafts.csswg.org/css-nesting/#conditionals

Specifically, these rules are capable of being nested group rules:
all the conditional group rules (@media, @supports)

@romainmenke romainmenke added the status: needs discussion triage needs further discussion label Jul 9, 2023
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule and removed status: needs discussion triage needs further discussion labels Jul 9, 2023
@ybiquitous ybiquitous added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule
3 participants