Skip to content

astro-check (error): TipLicense xmlns:cc and rel attrs not on Props #571

Description

@lsr-explore

TipLicense xmlns:cc and rel attrs not on Props

Labels: types, cosmetic
Estimated PR size: 1–2 files

Note

Ticket description was generated using Claude Code. Review before starting on a fix.

Note

The following issue adds support for npm run astro:check

Summary

Two attribute typing issues in src/components/TipLicense.astro:

  1. <p xmlns:cc="..."> — TS doesn't recognize the xmlns:cc namespace declaration on a paragraph.
  2. <ExternalLink rel="license noopener noreferrer">ExternalLink's Props doesn't declare rel.

Both are cosmetic — they don't affect runtime behavior — but they trip astro check.

astro check errors

src/components/TipLicense.astro:18:7 - error ts(2322): Type '{ children: string; inline: true; href: string; rel: string; }' is not assignable to type 'IntrinsicAttributes & Props'.
  Property 'rel' does not exist on type 'IntrinsicAttributes & Props'.

18       rel="license noopener noreferrer">CC BY-NC-SA 4.0</ExternalLink
         ~~~
src/components/TipLicense.astro:13:26 - error ts(2322): Type '{ children: any[]; class: string; "xmlns:cc": string; }' is not assignable to type 'HTMLAttributes'.
  Property 'xmlns:cc' does not exist on type 'HTMLAttributes'.

13   <p class="text-center" xmlns:cc="http://creativecommons.org/ns#">
                            ~~~~~~~~

Suggested fix

For (1) — the xmlns:cc namespace: TS's HTML types don't expose arbitrary xmlns:* attrs. Options:

  • Use a set:html block to inject the <p> markup raw (preserves the attribute, hides from typechecker).
  • Drop xmlns:cc if it's only there for older Creative Commons RDFa metadata and you don't actually consume it.

For (2) — rel on ExternalLink: add rel?: string to ExternalLink.astro's Props and forward it to the underlying <a>. Since this is a license link and the existing value adds noopener noreferrer, also verify whether ExternalLink already sets noopener noreferrer by default — if so, the caller only needs rel="license".

Affected files

  • src/components/TipLicense.astro
  • src/components/ExternalLink.astro (if (2) requires adding rel to Props)

Acceptance criteria

  • Both errors clear.
  • License link on tip pages still opens in new tab and includes appropriate rel attributes.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

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