镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Multi-line format of composes breaks parsing #54

Closed

Description

@viveleroi

As of prettier v3, they now split CSS declarations by commas so multiple entries in composes: declarations are included.

.title {
  composes:
    body-copy,
    text-ellipsis from global;
}
Internal server error: [postcss] postcss-modules-scope: C:/Users/.../app/components/tree/tree.module.css:132:3: referenced class name "body-copy," in composes not found
[vite]   Plugin: vite:css
[vite]   File: C:/Users/.../app/components/tree/tree.module.css:132:3
[vite]   130|
[vite]   131|  .title {
[vite]   132|    composes:
[vite]      |     ^
[vite]   133|      body-copy,
[vite]   134|      text-ellipsis from global;

But this code worked fine as a single line, so we use the /* prettier ignore */ comment for now.

.title {
  /* prettier-ignore */
  composes: body-copy, text-ellipsis from global;
}

Activity

  1. alexander-akait commented on Dec 21, 2023

    @alexander-akait
    Member

    Sorry, it never works like you wrote, you can't use , in right now, but it sounds useful, we need update such things in all plugins

  2. alexander-akait commented on Dec 21, 2023

    @alexander-akait
    Member

    Do you want to send a PRs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions