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

Add support for nested properties in rule declaration-property-value-no-unknown. #7310

Closed
pamelalozano16 opened this issue Nov 7, 2023 · 3 comments
Labels
status: needs discussion triage needs further discussion

Comments

@pamelalozano16
Copy link

What is the problem you're trying to solve?

Rule declaration-property-value-no-unknown doesn't work for SCSS nested properties. So font-size: red; raises an error, but font: { size: red; } does not.

Demo here.

What solution would you like to see?

Although this is a SCSS-specific feature, @kristerkari suggested we support nested properties in declaration-property-value-no-unknown Stylelint CSS rule to avoid duplicate code and encourage code reusability.

@jeddy3
Copy link
Member

jeddy3 commented Nov 7, 2023

@pamelalozano16 Thanks for the request and for using the template.

It's unlikely we'll add support for nested properties to the built-in rule as we're focused on balancing support for modern CSS against the long-term maintenance of the project. The CSS language is constantly improving and growing, so we have to focus the time we have on supporting that.

We sometimes add secondary options, like ignoreAtRules: [], to help the stylelint-scss authors reuse code via stylelint.utils.checkAgainstRule. But this is only applicable when SCSS uses a standard construct, like custom at-rules e.g. @debug.

As nested properties are a non-standard construct, stylelint-scss authors will need to mirror the rule if they want to support them. Or they may, and I'm just throwing this out there, add a no-nested-properties rule to discourage their use.

@jeddy3 jeddy3 added the status: needs discussion triage needs further discussion label Nov 7, 2023
@Mouvedia Mouvedia added the syntax: scss relates to SCSS and SCSS-like syntax label Nov 7, 2023
@jeddy3 jeddy3 removed the syntax: scss relates to SCSS and SCSS-like syntax label Nov 7, 2023
@jeddy3
Copy link
Member

jeddy3 commented Nov 7, 2023

(@Mouvedia Thanks for triaging the issue. We've got a guide for consistent labels).

@jeddy3
Copy link
Member

jeddy3 commented Dec 17, 2023

Closing as we are unlikely to add support for non-standard syntax to the built-in rules and will continue to use the isStandardSyntax* utils to ignore them so that the rules are somewhat useful for language extensions.

@jeddy3 jeddy3 closed this as completed Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion triage needs further discussion
Development

No branches or pull requests

3 participants