mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
chore: upgrade TypeScript & other ESLint related deps (#5963)
* chore: upgrade ESLint related deps * Upgrade TS * Fix lock * Bump Babel * Update config
This commit is contained in:
parent
2f7d6fea1e
commit
0374426ce3
104 changed files with 2662 additions and 2487 deletions
|
@ -31,13 +31,12 @@ export function getActivePlugin(
|
|||
options: GetActivePluginOptions = {},
|
||||
): ActivePlugin | undefined {
|
||||
const activeEntry = Object.entries(allPluginDatas).find(
|
||||
([_id, pluginData]) => {
|
||||
return !!matchPath(pathname, {
|
||||
([_id, pluginData]) =>
|
||||
!!matchPath(pathname, {
|
||||
path: pluginData.path,
|
||||
exact: false,
|
||||
strict: false,
|
||||
});
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
const activePlugin: ActivePlugin | undefined = activeEntry
|
||||
|
@ -63,9 +62,8 @@ export type ActiveDocContext = {
|
|||
alternateDocVersions: Record<string, Doc>;
|
||||
};
|
||||
|
||||
export const getLatestVersion = (data: GlobalPluginData): Version => {
|
||||
return data.versions.find((version) => version.isLast)!;
|
||||
};
|
||||
export const getLatestVersion = (data: GlobalPluginData): Version =>
|
||||
data.versions.find((version) => version.isLast)!;
|
||||
|
||||
// Note: return undefined on doc-unrelated pages,
|
||||
// because there's no version currently considered as active
|
||||
|
@ -80,13 +78,14 @@ export const getActiveVersion = (
|
|||
...data.versions.filter((version) => version !== lastVersion),
|
||||
lastVersion,
|
||||
];
|
||||
return orderedVersionsMetadata.find((version) => {
|
||||
return !!matchPath(pathname, {
|
||||
path: version.path,
|
||||
exact: false,
|
||||
strict: false,
|
||||
});
|
||||
});
|
||||
return orderedVersionsMetadata.find(
|
||||
(version) =>
|
||||
!!matchPath(pathname, {
|
||||
path: version.path,
|
||||
exact: false,
|
||||
strict: false,
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
export const getActiveDocContext = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue