Skip to content

Un-exempt src/components/Comments.astro once prettier-plugin-astro can parse it #42

Description

@kpab

Context

src/components/Comments.astro is the one source file .prettierignore exempts (added in #38). prettier-plugin-astro cannot parse it:

[error] src/components/Comments.astro: SyntaxError: CssSyntaxError: Unknown word ` (19:9)

The component guards everything behind {enabled && ( … )} so a default build ships zero Giscus bytes. Inside that expression the children parse as JSX, so raw CSS braces would be read as expressions — the <style is:inline>{\…`}</style>template literal is what makes scoped CSS possible there. The plugin chokes on the backtick. Rewriting it asset:html` would move the CSS out of the markup purely to satisfy the formatter, so the file is ignored and CONTRIBUTING.md asks contributors to keep it tidy by hand.

Nothing currently prompts anyone to revisit this, which is what this issue is for.

Scope

  • Find or file the corresponding upstream issue on withastro/prettier-plugin-astro and link it here.
  • On each plugin bump, re-test:
    npx prettier --ignore-path /dev/null --check src/components/Comments.astro
  • When it parses, drop the file (and its explanatory comment) from .prettierignore, run npm run format, and remove the "keep that file tidy by hand" sentence from CONTRIBUTING.md.

Acceptance criteria

  • The command above exits 0.
  • .prettierignore lists only CHANGELOG.md among tracked source files.
  • Formatting Comments.astro produces no rendered-output change — the built dist/ for a Giscus-enabled config is unchanged.

Activity

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

    ciCI, automation, and repository tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions