mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +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
|
@ -177,7 +177,7 @@ export default function themeClassic(
|
|||
const plugin: PostCssPlugin = {
|
||||
postcssPlugin: 'RtlCssPlugin',
|
||||
prepare: (result) => {
|
||||
const file = result.root?.source?.input?.file;
|
||||
const file = result.root.source?.input.file;
|
||||
// Skip Infima as we are using the its RTL version.
|
||||
if (file === resolvedInfimaFile) {
|
||||
return {};
|
||||
|
|
|
@ -21,12 +21,14 @@
|
|||
// in their tsconfig.
|
||||
|
||||
declare module '@docusaurus/theme-classic' {
|
||||
import type {LoadContext, Plugin} from '@docusaurus/types';
|
||||
import type {LoadContext, Plugin, PluginModule} from '@docusaurus/types';
|
||||
|
||||
export type Options = {
|
||||
customCss?: string | string[];
|
||||
};
|
||||
|
||||
export const getSwizzleConfig: PluginModule['getSwizzleConfig'];
|
||||
|
||||
export default function themeClassic(
|
||||
context: LoadContext,
|
||||
options: Options,
|
||||
|
|
|
@ -52,7 +52,7 @@ export default function CodeBlockString({
|
|||
magicComments,
|
||||
});
|
||||
const showLineNumbers =
|
||||
showLineNumbersProp || containsLineNumbers(metastring);
|
||||
showLineNumbersProp ?? containsLineNumbers(metastring);
|
||||
|
||||
return (
|
||||
<Container
|
||||
|
|
|
@ -23,7 +23,7 @@ export default function DocSidebarItemHtml({
|
|||
className={clsx(
|
||||
ThemeClassNames.docs.docSidebarItemLink,
|
||||
ThemeClassNames.docs.docSidebarItemLinkLevel(level),
|
||||
defaultStyle && `${styles.menuHtmlItem} menu__list-item`,
|
||||
defaultStyle && [styles.menuHtmlItem, 'menu__list-item'],
|
||||
className,
|
||||
)}
|
||||
key={index}
|
||||
|
|
|
@ -21,7 +21,7 @@ function ColumnLinkItem({item}: {item: ColumnItemType}) {
|
|||
dangerouslySetInnerHTML={{__html: item.html}}
|
||||
/>
|
||||
) : (
|
||||
<li key={item.href || item.to} className="footer__item">
|
||||
<li key={item.href ?? item.to} className="footer__item">
|
||||
<LinkItem item={item} />
|
||||
</li>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue