Skip to content

Fixes lint#308

Merged
arcanis merged 1 commit into
mainfrom
mael/blush-stocking
Jun 11, 2026
Merged

Fixes lint#308
arcanis merged 1 commit into
mainfrom
mael/blush-stocking

Conversation

@arcanis

@arcanis arcanis commented Jun 11, 2026

Copy link
Copy Markdown
Member

Note

Low Risk
Lint and formatting with limited logic changes; docs terminal copy and quiz share toasts are the only small UX deltas to sanity-check.

Overview
Brings the Yarn website back in line with the repo ESLint setup by extending root eslint.config.mjs with website-specific globals, default-export exceptions, and targeted rule disables (e.g. no-control-regex for terminal recording).

Across website/, the diff is mostly mechanical lint/style fixes: backtick strings, brace style, Array<> / ReadonlyArray<> types, import ordering, and explicit useEffect cleanups. Markdown plugins (remark-docs, rehype-footnote-tooltips, rehype-docs) get small control-flow tweaks (e.g. visit callbacks no longer return stale indices).

A few behavioral tweaks worth a quick look: docs copy now builds terminal clipboard text by skipping out/comment lines instead of re-prefixing prompts; quiz drops the shared showToast helper (share feedback is label-only); package StatGrid stops computing an unused file count.

Tooling: website/tsconfig.json enables composite declaration emit; adds website/src/env.d.ts for Astro client types; cli.ts types Clipanion components via Extract instead of hand-rolled shapes.

Reviewed by Cursor Bugbot for commit aa3ad8d. Bugbot is set up for automated code reviews on this repo. Configure here.

@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for yarn-v6 ready!

Name Link
🔨 Latest commit aa3ad8d
🔍 Latest deploy log https://app.netlify.com/projects/yarn-v6/deploys/6a2adcd4bdce7a000927c842
😎 Deploy Preview https://deploy-preview-308--yarn-v6.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Terminal copy omits prompts
    • Terminal copy now preserves output lines and reconstructs CSS-rendered prompts and comment markers.
  • ✅ Fixed: Code copy throws without pre
    • Code copy now falls back to the block element text when no nested pre or code element exists.

Create PR

Or push these changes by commenting:

@cursor push 86c19f77c5
Preview (86c19f77c5)
diff --git a/website/public/docs/docs.js b/website/public/docs/docs.js
--- a/website/public/docs/docs.js
+++ b/website/public/docs/docs.js
@@ -108,12 +108,21 @@
     btn.setAttribute(`aria-label`, `Copy code`);
     btn.innerHTML = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.4"><rect x="3" y="3" width="7" height="7" rx="1"/><path d="M2 8V2h6" opacity="0.6"/></svg>`;
     btn.addEventListener(`click`, () => {
-      const toCopy = el.classList.contains(`terminal`)
-        ? Array.from(el.querySelectorAll(`.term-line`))
-          .filter(l => !l.classList.contains(`out`) && !l.classList.contains(`comment`))
-          .map(l => l.textContent)
-          .join(`\n`)
-        : (el.querySelector(`pre code`) || el.querySelector(`pre`)).textContent;
+      let toCopy;
+      if (el.classList.contains(`terminal`)) {
+        toCopy = Array.from(el.querySelectorAll(`.term-line`))
+          .map(l => {
+            let prefix = `$ `;
+            if (l.classList.contains(`out`) || l.classList.contains(`no-prompt`)) prefix = ``;
+            if (l.classList.contains(`comment`)) prefix = `# `;
+
+            return `${prefix}${l.textContent}`;
+          })
+          .join(`\n`) || el.textContent;
+      } else {
+        const code = el.querySelector(`pre code`) || el.querySelector(`pre`);
+        toCopy = (code || el).textContent;
+      }
       navigator.clipboard?.writeText(toCopy).then(() => {
         btn.classList.add(`copied`);
         btn.innerHTML = `<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M2 6l3 3 5-6"/></svg>`;

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit aa3ad8d. Configure here.

const text = Array.from(el.querySelectorAll(`.term-line, pre code, pre`))
.map(line => {
if (line.classList && line.classList.contains(`term-line`)) {
if (line.classList.contains(`no-prompt`) || line.classList.contains(`out`)) return line.textContent;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminal copy omits prompts

Medium Severity

The docs copy handler for .terminal blocks now drops .term-line.out and .term-line.comment lines and copies only raw textContent from command lines. Pasted snippets no longer include shell output, # comments, or $ prompts (shown via CSS, not in the DOM), so copied terminal examples differ from what readers see on the page.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aa3ad8d. Configure here.

.map(line => {
if (line.classList && line.classList.contains(`term-line`)) {
if (line.classList.contains(`no-prompt`) || line.classList.contains(`out`)) return line.textContent;
if (line.classList.contains(`comment`)) return `# ${line.textContent}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code copy throws without pre

Medium Severity

For non-terminal copy targets, the handler reads (el.querySelector('pre code') || el.querySelector('pre')).textContent with no fallback. If neither element exists inside a .code-block, the click handler throws when accessing textContent on null, so copy fails instead of falling back to the block’s text.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aa3ad8d. Configure here.

@arcanis arcanis merged commit c99735e into main Jun 11, 2026
24 of 25 checks passed
@arcanis arcanis deleted the mael/blush-stocking branch June 11, 2026 16:22
@github-actions

Copy link
Copy Markdown

⏱️ Benchmark Results

gatsby install-full-cold

Metric Base Head Difference
Mean 4.466s 4.454s -0.26% ✅
Median 4.469s 4.457s -0.25% ✅
Min 4.357s 4.310s
Max 4.589s 4.574s
Std Dev 0.049s 0.063s
📊 Raw benchmark data (gatsby install-full-cold)

Base times: 4.497s, 4.402s, 4.504s, 4.451s, 4.357s, 4.492s, 4.500s, 4.503s, 4.532s, 4.458s, 4.414s, 4.456s, 4.455s, 4.414s, 4.452s, 4.407s, 4.490s, 4.484s, 4.425s, 4.488s, 4.477s, 4.507s, 4.589s, 4.401s, 4.526s, 4.437s, 4.460s, 4.399s, 4.481s, 4.510s

Head times: 4.461s, 4.439s, 4.384s, 4.408s, 4.412s, 4.518s, 4.485s, 4.310s, 4.381s, 4.510s, 4.481s, 4.460s, 4.454s, 4.455s, 4.330s, 4.477s, 4.507s, 4.440s, 4.448s, 4.525s, 4.531s, 4.455s, 4.506s, 4.523s, 4.358s, 4.469s, 4.574s, 4.420s, 4.387s, 4.505s


gatsby install-cache-only

Metric Base Head Difference
Mean 1.290s 1.295s +0.37% ⚠️
Median 1.290s 1.294s +0.31% ⚠️
Min 1.267s 1.277s
Max 1.309s 1.332s
Std Dev 0.011s 0.012s
📊 Raw benchmark data (gatsby install-cache-only)

Base times: 1.274s, 1.299s, 1.285s, 1.280s, 1.292s, 1.291s, 1.308s, 1.301s, 1.309s, 1.300s, 1.284s, 1.289s, 1.294s, 1.279s, 1.272s, 1.290s, 1.289s, 1.299s, 1.304s, 1.278s, 1.279s, 1.286s, 1.286s, 1.278s, 1.290s, 1.267s, 1.307s, 1.304s, 1.293s, 1.299s

Head times: 1.301s, 1.298s, 1.295s, 1.288s, 1.279s, 1.313s, 1.278s, 1.299s, 1.285s, 1.279s, 1.294s, 1.283s, 1.278s, 1.316s, 1.291s, 1.302s, 1.304s, 1.294s, 1.299s, 1.277s, 1.289s, 1.293s, 1.308s, 1.298s, 1.293s, 1.332s, 1.291s, 1.291s, 1.300s, 1.299s


gatsby install-cache-and-lock (warm, with lockfile)

Metric Base Head Difference
Mean 0.354s 0.351s -0.78% ✅
Median 0.352s 0.350s -0.48% ✅
Min 0.349s 0.343s
Max 0.376s 0.361s
Std Dev 0.006s 0.004s
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))

Base times: 0.354s, 0.357s, 0.359s, 0.349s, 0.351s, 0.351s, 0.350s, 0.351s, 0.350s, 0.359s, 0.349s, 0.350s, 0.354s, 0.357s, 0.349s, 0.355s, 0.360s, 0.365s, 0.376s, 0.351s, 0.352s, 0.352s, 0.353s, 0.352s, 0.353s, 0.350s, 0.350s, 0.351s, 0.349s, 0.356s

Head times: 0.355s, 0.353s, 0.352s, 0.347s, 0.350s, 0.361s, 0.360s, 0.356s, 0.354s, 0.350s, 0.349s, 0.348s, 0.343s, 0.356s, 0.357s, 0.349s, 0.349s, 0.353s, 0.347s, 0.353s, 0.352s, 0.348s, 0.346s, 0.346s, 0.346s, 0.351s, 0.350s, 0.350s, 0.350s, 0.353s

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.

1 participant