Repository navigation
refactor: remove the remaining dead code leftovers (AI-assisted) - #12751
Merged
Merged
Conversation
Only used by its own test since the showcase refactor (#10023). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isted) validateAuthorsMap() was an exact copy of validateAuthorsMapInput(), and only tests used it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AI-assisted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ma (AI-assisted) DEFAULT_OPTIONS was only used by tests. Using it in the schema, like the other plugins do, keeps the tested defaults and the real defaults in sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-ideal-image fork (AI-assisted) - MediaWithDefaults: never imported - Commented-out getScreenWidth(), supportsWebp() and fetchLoader() - Commented-out tests, and the test import they left unused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No test reads these fixture sites: - docs bad-id-site: unused since the docs plugin refactor (#3245) - docs bad-slug-on-doc-home-site: unused since the docs plugin refactor (#3245) - utils vcs simple-site: added with the VCS API (#11512), never read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AI-assisted) Added with the flat TOC refactor (#6729), but no theme ever used it: themes use useFilteredAndTreeifiedTOC. Only its own test called it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssisted) These CSS module classes are not used by any component anymore, and the React MDX docs page imported a CSS module it doesn't use since the MDX v2 docs rewrite (#8941). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The active nav link is styled with the activeStyle prop since the plugin was released (#3392), so the CSS module class was never applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on key (AI-assisted) theme.docs.DocCard.categoryDescription was replaced by the .plurals key in #9851, but the Icelandic translation (#9928) still declared the old key, and the new key was untranslated. Move the translation to the plurals key: "atriði" is the same in singular and plural. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e files (AI-assisted) The update script only logs an error for these stale localized messages, so they can remain unnoticed for a long time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AI-assisted) - jest/vendor: removed with the Vitest migration (#12010) - templates/facebook: removed in #9026 - website/docusaurus.config.js: now a TypeScript file (#9317) - docusaurus-migrate: removed in #9400 - website/netlifyDeployPreview: removed in #4447 - .cache-loader: cache-loader was removed with Webpack 5 (#4089) - .svg: a typo for the *.svg pattern right below - commented-out website/i18n/fr gitignore negations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(AI-assisted) - plugin-svgr: @svgr/core is only used by tests (@svgr/webpack depends on it) - theme-classic: react-router-dom is only used by tests, theme components use @docusaurus/router Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es (AI-assisted) - New lint:knip:production check: Knip production mode ignores the tests, so it reports the exports and dependencies of published packages that only tests use. Exports also used in their own file are not reported: functions are often exported only to be tested. - Fail on Knip configuration hints, so that the config doesn't accumulate useless entries, and remove the 3 existing ones. - Don't treat the internal modules of the react-ideal-image fork as theme component entries, so that Knip reports the unused ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 6
✨ Finishing Touches
Comment |
|
Size Change: +70 B (0%) Total Size: 12.1 MB 📦 View Changed
ℹ️ View Unchanged
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: +70 B (0%) Total Size: 12.1 MB 📦 View Changed
ℹ️ View Unchanged
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎ Awaiting the start of a new Argos build… |
This was referenced Oct 23, 2026
Merged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slorber
marked this pull request as ready for review
October 23, 2026 16:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the last dead code leftovers of the dead-code sweep: 10 deleted lines in 6 files, no behavior change.
CategoryMetadataFilenameBaseconstant (zero references).activeCSS class (theactiveStyleprop styles the active link since feat(v2): officially release @docusaurus/plugin-debug #3392)emojiUtils,useTOCHighlight, sidebars validation, and a debugconsole.login the MDX loadercontentTitlepluginThis PR started as the validation PR of the sweep: all the findings were removed here first so that CI could check them at once, then split into the standalone PRs below. The rest of this description is the sweep report.
Motivation
Find the dead code of the repository, check that removing it is safe, and prevent new dead code.
Knip already runs in CI, so the remaining dead code hides in Knip's blind spots. I combined:
--production+ignoreExportsUsedInFile(code only kept alive by tests, the main technique of TkDodo's talk),--include-entry-exports, namespace members, duplicates@theme/*declarations, test fixtures, snapshots, translation keys, plugin options, static assets, tooling config paths, ESLint globs, workflow scripts@typescript-eslint/no-unnecessary-conditionrun (dead branches)Already handled in standalone PRs
lint:knip:productioncheck (exports and dependencies only used by tests), with the 2 fixes it needed: css-cascade-layersDEFAULT_OPTIONS,@svgr/core+react-router-dommoved todevDependenciesMediaWithDefaults+ commented-out functions and tests/internal:useTreeifiedTOC+ unused re-exports (breaking)toggleListItem, 9 unused CSS module classes, unused CSS moduleupdate-translationscommand (found while working on #12767)lint:knip:public-apiscript +AGENTS.mdrule: public API exports are never dead codevalidateAuthorsMap()duplicategroupBy()export removed, nativeObject.groupBy()used instead (breaking)test-bad-packageReact DOM check, and more stale configlistStorageKeysaddSuffix./lib/*and./src/*wildcard exports of 4 packages (breaking)Needs a decision (not in this PR)
Low-value leftovers, I'd keep them:
website/static/img/slash-introducing.png,img/meta_opensource_logo.svg. Public URLs, maybe hot-linkedconst DEBUG = false(utils/src/moduleUtils.ts),const disableOptimization = false(core/src/server/brokenLinks.ts). IntentionalpropTypesin the ideal-image fork (Media,IdealImage): they document props, duplicated byplugin-ideal-image.d.tsFollow-ups found by #12773, out of its scope: the README license badge shows the license of another project, the Gitpod badge and
.gitpod.ymlmay be dead,admin/publish-legacy.mdis stale, and the site templates'gitignorestill lists.cache-loader.Unused public API exports are listed by
pnpm lint:knip:public-api(#12769), as warnings only.Checked, nothing to remove
Details
@theme/*imports, routes or MDX. Alldeclare module '@theme/*'have an implementation,module-type-aliasesmatches the core exports.snapfilesfilesglobs: all usedTODO Docusaurus v4markers are planned removals (DocSearch v3...), not dead codeno-unnecessary-condition: ~70 hits, nearly all defensive checks of untyped user input. Not dead code, and too noisy for CIminifyFunctions.tsis loaded by path in worker processes)Methodology notes and side findings
cli.test.tsof the docs plugin contains a literal NUL byte (an invalid"foo\0bar"version name in an inline snapshot), so ripgrep/grep silently skip it as a binary file. It madesite-with-custom-i18n-pathlook unused, but removing it failed the tests: that fixture is kept.admin/test-bad-package/README.mdxcheckedReactVersiontwice, so its React DOM version check never ran. Fixed in chore: clean up stale monorepo tooling config (AI-assisted) #12773.listStorageKeysandaddSuffixbecause the monorepo doesn't use them, but they are public API (break(theme-common): removelistStorageKeys(AI-assisted) #12763 and break(utils-common): remove unusedaddSuffix()(AI-assisted) #12765 closed). chore(knip): addlint:knip:public-apito warn about public API exports the monorepo doesn't use (AI-assisted) #12769 adds anAGENTS.mdrule so that agents don't do it again.Test Plan
Full CI on this PR. Argos found no screenshot changes. The
styles.csstext snapshot change came from the website CSS cleanup, now merged in #12766. The Argos screenshot quota is currently exhausted, sotake-screenshotsmay fail for that reason only.Test links
Deploy preview: https://deploy-preview-12751--docusaurus-2.netlify.app/
🤖 Generated with Claude Code (AI-assisted)