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 positives for env() #6635

Closed
romainmenke opened this issue Feb 10, 2023 · 3 comments · Fixed by #6646
Closed

Fix declaration-property-value-no-unknown false positives for env() #6635

romainmenke opened this issue Feb 10, 2023 · 3 comments · Fixed by #6646
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule upstream relates to an upstream package

Comments

@romainmenke
Copy link
Member

What steps are needed to reproduce the bug?

a {
  margin: env(safe-area-inset-bottom);
}

What Stylelint configuration is needed to reproduce the bug?

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

How did you run Stylelint?

CLI and VSCode

Which version of Stylelint are you using?

15.0.0

What did you expect to happen?

I expected env() to be allowed in the same way as var()

What actually happened?

 ⚠  Unexpected unknown value "env(" for property "padding-bottom"  declaration-property-value-no-unknown

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

No response

@Mouvedia
Copy link
Contributor

That was to be expected. I'd say since env, clamp and the other unsupported css functions are included in css-functions-list which is already used by the function-no-unknown rule, we should reuse it until csstree gets patched.
The 2 PR that I sent 1 week ago will probably remain unanswered for a long time, so adding another wouldn't help; let's fix it on our side for now.

@Mouvedia Mouvedia added the type: bug a problem with a feature or rule label Feb 10, 2023
@jeddy3 jeddy3 changed the title Allow env() in declaration-property-value-no-unknown Fix declaration-property-value-no-unknown false positives for env() Feb 10, 2023
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone upstream relates to an upstream package labels Feb 10, 2023
@jeddy3
Copy link
Member

jeddy3 commented Feb 10, 2023

@romainmenke Thanks for the report and for using the template.

Let's:

For the latter, we can take the same approach as clamp/min/max, i.e. returning early if an env node is present.

Spec for env() for reference.

I've labelled the issue as ready to implement. Please consider contributing if you have time.

There are steps on how to fix a bug in a rule in the Developer guide.


@Mouvedia Thank you for triaging the issue. Our conventions for triaging them consistently are in the maintainer guide.

@romainmenke
Copy link
Member Author

@jeddy3 jeddy3 added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Feb 10, 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 upstream relates to an upstream package
Development

Successfully merging a pull request may close this issue.

3 participants