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 unit-no-unknown false positives for font-relative length units #6373

Closed
ybiquitous opened this issue Sep 29, 2022 · 0 comments · Fixed by #6374
Closed

Fix unit-no-unknown false positives for font-relative length units #6373

ybiquitous opened this issue Sep 29, 2022 · 0 comments · Fixed by #6374
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@ybiquitous
Copy link
Member

What steps are needed to reproduce the bug?

For example, the CSS code using the ic unit:

a { width: 10ic; }

We can reproduce the bug on the demo.

What Stylelint configuration is needed to reproduce the bug?

{
  "rules": {
    "unit-no-unknown": true
  }
}

How did you run Stylelint?

CLI with stylelint *.css

Which version of Stylelint are you using?

14.13.0

What did you expect to happen?

No problems are to be reported.

What actually happened?

The following problem is reported:

test.css
 1:14  ✖  Unexpected unknown unit "ic"  unit-no-unknown

1 problem (1 error, 0 warnings)

Does the bug relate to non-standard syntax?

No.

Proposal to fix the bug

To Update the internal list for the units:

const lengthUnits = new Set([
// Relative length units
'em',
'ex',
'ch',
'rem',
'rlh',
'lh',

@ybiquitous ybiquitous added status: wip is being worked on by someone type: bug a problem with a feature or rule labels Sep 29, 2022
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
Development

Successfully merging a pull request may close this issue.

1 participant