Skip to content

@stylexjs/valid-styles ESLint bug: outlineWidth doesn’t allow calc() #1690

Description

@drwpow-figma

Describe the issue

outlineWidth doesn’t accept calc() as a valid style:

const styles = stylex.create({
  foo: {
    outlineWidth: 'calc(0.25rem + 1px)',
                  ~~~~~~~~~~~~~~~~~~~~~
// outlineWidth value must be one of:
// a number literal or math expression
// a number ending in px, mm, in, pc, pt
// a number ending in ch, em, ex, ic, rem, vh, vw, vmin, vmax, svh, dvh, lvh, svw, // dvw, ldw, cqw, cqh, cqmin, cqmax
// null
// initial
// inherit
// unset
// revert
  },
})

Expected behavior

Allow calc() for widths

Steps to reproduce

  • @stylexjs/eslint-plugin: 0.18.3

Test case

(see above)

Additional comments

Also throws an error for nested pseudoselector syntax too

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions