Skip to content

chore(docs): clear straightforward lint errors#472

Merged
mrholek merged 1 commit into
mainfrom
fix/lint-docs
Jun 13, 2026
Merged

chore(docs): clear straightforward lint errors#472
mrholek merged 1 commit into
mainfrom
fix/lint-docs

Conversation

@mrholek

@mrholek mrholek commented Jun 13, 2026

Copy link
Copy Markdown
Member

Part of bringing yarn lint to zero (follow-up to #468#471). Docs site only — does not touch the published library.

Changes

  • Header: drop unused icon imports (cibOpenCollective, cibTwitter, cilCloudDownload, cilExternalLink) and replace the empty ({}, ref) destructuring with (_, ref) (no-unused-vars, no-empty-pattern).
  • Seo: hoist the pure humanize and getDynamicDescription helpers out of the component to module scope (consistent-function-scoping).
  • projectUtils / ClassNamesDocs: .sort().toSorted() (no-array-sort).
  • ScssDocs: String.raw for the scss-docs capture regex (prefer-string-raw).
  • ExampleSnippetLazy: collapse children ? children : … to children || … (prefer-logical-operator-over-ternary).

Reduces docs eslint errors from 19 to 8.

Deliberately deferred

The remaining 8 are a render-time refactor that needs verification against a running docs build, grouped into a dedicated PR with the library's react-hooks v7 work:

  • CodeBlock / ScssDocs: the prismjs language registration assigns globalThis.Prism and require()s prism components during render, with a load-order constraint ESM static imports can't trivially satisfy (react-hooks/immutability, no-require-imports).
  • ExampleSnippet / ExampleSnippetLazy: react-hooks/static-components and set-state-in-effect.

No automated tests cover the docs package; changes verified via eslint parse (no tsconfig — Gatsby/babel).

- drop unused icon imports and the empty destructuring pattern in Header
- hoist the pure humanize and getDynamicDescription helpers in Seo out of
  the component (consistent-function-scoping)
- use toSorted in projectUtils and ClassNamesDocs (no-array-sort)
- use String.raw for the scss-docs capture regex (prefer-string-raw)
- collapse the children ternary to a logical operator in ExampleSnippetLazy

The remaining docs errors (prismjs require side-effects in CodeBlock/ScssDocs,
and the react-hooks static-components/set-state-in-effect findings in the
ExampleSnippet components) need a render-time refactor verified against a
running docs build and are left for a dedicated PR.
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