mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-28 15:37:49 +02:00
refactor: fix a lot of errors in type-aware linting (#7477)
This commit is contained in:
parent
222bf3c091
commit
bf1513a3e3
120 changed files with 407 additions and 364 deletions
|
@ -126,6 +126,6 @@ export function getDocVersionSuggestions(
|
|||
const latestVersion = getLatestVersion(data);
|
||||
const activeDocContext = getActiveDocContext(data, pathname);
|
||||
const latestDocSuggestion: GlobalDoc | undefined =
|
||||
activeDocContext?.alternateDocVersions[latestVersion.name];
|
||||
activeDocContext.alternateDocVersions[latestVersion.name];
|
||||
return {latestDocSuggestion, latestVersionSuggestion: latestVersion};
|
||||
}
|
||||
|
|
|
@ -34,9 +34,11 @@ const StableEmptyObject = {};
|
|||
// In blog-only mode, docs hooks are still used by the theme. We need a fail-
|
||||
// safe fallback when the docs plugin is not in use
|
||||
export const useAllDocsData = (): {[pluginId: string]: GlobalPluginData} =>
|
||||
(useAllPluginInstancesData('docusaurus-plugin-content-docs') as {
|
||||
[pluginId: string]: GlobalPluginData;
|
||||
}) ?? StableEmptyObject;
|
||||
(useAllPluginInstancesData('docusaurus-plugin-content-docs') as
|
||||
| {
|
||||
[pluginId: string]: GlobalPluginData;
|
||||
}
|
||||
| undefined) ?? StableEmptyObject;
|
||||
|
||||
export const useDocsData = (pluginId: string | undefined): GlobalPluginData =>
|
||||
usePluginData('docusaurus-plugin-content-docs', pluginId, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue