Skip to content

Possibly incorrect css-syntax-error? #3265

@brc-dd

Description

@brc-dd

Prettier v3 formats some code like this:

:is(.vp-external-link-icon, .vp-doc a[href*=":/\/"], .vp-doc a[target="_blank"]):not(.no-icon) {
  color: red;
}

to

:is(
    .vp-external-link-icon,
    .vp-doc a[href*=":/\/"],
    .vp-doc a[target="_blank"]
  ):not(.no-icon) {
  color: red;
}

But with the latter syntax, esbuild gives this warning:

▲ [WARNING] Unexpected whitespace [css-syntax-error]

    <stdin>:1:4:
      1 │ :is(
        ╵     ^

If this is expected behavior, let me know. I'll create an issue at prettier.

Reproduction

https://esbuild.github.io/try/#dAAwLjE4LjE1AC0tbG9hZGVyPWNzcwA6aXMoCiAgICAudnAtZXh0ZXJuYWwtbGluay1pY29uLAogICAgLnZwLWRvYyBhW2hyZWYqPSI6L1wvIl0sCiAgICAudnAtZG9jIGFbdGFyZ2V0PSJfYmxhbmsiXQogICk6bm90KC5uby1pY29uKSB7CiAgY29sb3I6IHJlZDsKfQ

Related issues

vitejs/vite#13914

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions