mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-08 13:52:36 +02:00
chore: clean up ESLint config, enable a few rules (#6514)
* chore: clean up ESLint config, enable a few rules * enable max-len for comments * fix build
This commit is contained in:
parent
b8ccb869f1
commit
aa446b7a9c
167 changed files with 1157 additions and 960 deletions
|
@ -112,29 +112,28 @@ export default async function pluginContentPages(
|
|||
options.routeBasePath,
|
||||
encodePath(fileToPath(relativeSource)),
|
||||
]);
|
||||
if (isMarkdownSource(relativeSource)) {
|
||||
const content = await fs.readFile(source, 'utf-8');
|
||||
const {
|
||||
frontMatter: unsafeFrontMatter,
|
||||
contentTitle,
|
||||
excerpt,
|
||||
} = parseMarkdownString(content);
|
||||
const frontMatter = validatePageFrontMatter(unsafeFrontMatter);
|
||||
return {
|
||||
type: 'mdx',
|
||||
permalink,
|
||||
source: aliasedSourcePath,
|
||||
title: frontMatter.title ?? contentTitle,
|
||||
description: frontMatter.description ?? excerpt,
|
||||
frontMatter,
|
||||
};
|
||||
} else {
|
||||
if (!isMarkdownSource(relativeSource)) {
|
||||
return {
|
||||
type: 'jsx',
|
||||
permalink,
|
||||
source: aliasedSourcePath,
|
||||
};
|
||||
}
|
||||
const content = await fs.readFile(source, 'utf-8');
|
||||
const {
|
||||
frontMatter: unsafeFrontMatter,
|
||||
contentTitle,
|
||||
excerpt,
|
||||
} = parseMarkdownString(content);
|
||||
const frontMatter = validatePageFrontMatter(unsafeFrontMatter);
|
||||
return {
|
||||
type: 'mdx',
|
||||
permalink,
|
||||
source: aliasedSourcePath,
|
||||
title: frontMatter.title ?? contentTitle,
|
||||
description: frontMatter.description ?? excerpt,
|
||||
frontMatter,
|
||||
};
|
||||
}
|
||||
|
||||
return Promise.all(pagesFiles.map(toMetadata));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue