chore(docs): clear straightforward lint errors#472
Merged
Conversation
- 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.
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.
Part of bringing
yarn lintto zero (follow-up to #468–#471). Docs site only — does not touch the published library.Changes
cibOpenCollective,cibTwitter,cilCloudDownload,cilExternalLink) and replace the empty({}, ref)destructuring with(_, ref)(no-unused-vars,no-empty-pattern).humanizeandgetDynamicDescriptionhelpers out of the component to module scope (consistent-function-scoping)..sort()→.toSorted()(no-array-sort).String.rawfor the scss-docs capture regex (prefer-string-raw).children ? children : …tochildren || …(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 assignsglobalThis.Prismandrequire()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-componentsandset-state-in-effect.No automated tests cover the docs package; changes verified via eslint parse (no tsconfig — Gatsby/babel).