refactor: fix more type-aware linting errors (#7479)

This commit is contained in:
Joshua Chen 2022-05-24 19:19:24 +08:00 committed by GitHub
parent bf1513a3e3
commit 624735bd92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 192 additions and 189 deletions

View file

@ -44,9 +44,10 @@ async function generateTemplateExample(template) {
`npm init docusaurus@latest examples/${template} ${command}`,
);
const templatePackageJson = await fs.readJSON(
`examples/${template}/package.json`,
);
const templatePackageJson =
await /** @type {Promise<import("../../packages/create-docusaurus/templates/classic/package.json") & { scripts: { [name: string]: string }; description: string }>} */ (
fs.readJSON(`examples/${template}/package.json`)
);
// Attach the dev script which would be used in code sandbox by default
templatePackageJson.scripts.dev = 'docusaurus start';