Skip to content

fix(external-link): strip whitespace inside external anchors + enforce lint rule - #1885

Draft
caugner wants to merge 2 commits into
lint-external-link-whitespacefrom
external-link-whitespace
Draft

fix(external-link): strip whitespace inside external anchors + enforce lint rule#1885
caugner wants to merge 2 commits into
lint-external-link-whitespacefrom
external-link-whitespace

Conversation

@caugner

@caugner caugner commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Fix 14 class="external" anchors so their content has no leading or trailing whitespace, using the >text</a form with the closing > on its own line, and elevate fred/no-external-link-whitespace from warn to error.

Motivation

Prevent the external-link icon (components/external-link/global.css) from wrapping onto the next line. Prettier wrapped the link text onto its own line, and Lit SSR preserves that whitespace. With the violations fixed, the rule can be enforced as an error.

Additional details

The anchor changes are the rule's autofix output (npx eslint --fix components hooks) followed by Prettier. Affected components: advertising, blog, compat-table, curriculum-landing, footer, observatory-results, scrim-inline.

Related issues and pull requests

Depends on: #1886.

@github-actions

Copy link
Copy Markdown
Contributor

56cdf09 was deployed to: https://fred-pr1885.review.mdn.allizom.net/

@caugner
caugner force-pushed the external-link-whitespace branch from 8043d9d to e110fe5 Compare September 10, 2026 12:20
@caugner
caugner changed the base branch from main to lint-external-link-whitespace September 10, 2026 12:20
@caugner
caugner added this pull request to stack #1887 September 10, 2026 12:20
@caugner caugner changed the title fix(external-link): strip whitespace inside external anchors fix(external-link): strip whitespace inside external anchors + enforce lint rule Sep 10, 2026
Prettier wrapped the link text of 14 `class="external"` anchors onto its
own line, and Lit SSR preserves that whitespace, so the external-link
icon wrapped onto the next line. Use the `>text</a` form with the
closing `>` on its own line, which Prettier keeps as-is.
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

Successfully merging this pull request may close these issues.

2 participants