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

Possibly incorrect css-syntax-error? #3265

Closed
brc-dd opened this issue Jul 21, 2023 · 1 comment
Closed

Possibly incorrect css-syntax-error? #3265

brc-dd opened this issue Jul 21, 2023 · 1 comment

Comments

@brc-dd
Copy link

brc-dd commented Jul 21, 2023

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

@evanw
Copy link
Owner

evanw commented Jul 22, 2023

Thanks for the report. This is definitely an esbuild bug, and is a recent regression due to lack of test coverage for this edge case. I'll fix this in the next release.

@evanw evanw closed this as completed in d645903 Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@evanw @brc-dd and others