mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 00:39:45 +02:00
chore(v2): Fix more eslint errors (#2976)
This commit is contained in:
parent
3611c96f90
commit
6e43c9bd34
81 changed files with 375 additions and 237 deletions
|
@ -11,7 +11,7 @@ const chalk = require('chalk');
|
|||
const semver = require('semver');
|
||||
const path = require('path');
|
||||
const program = require('commander');
|
||||
const {init} = require('../lib');
|
||||
const {default: init} = require('../lib');
|
||||
const requiredVersion = require('../package.json').engines.node;
|
||||
|
||||
if (!semver.satisfies(process.version, requiredVersion)) {
|
||||
|
|
|
@ -26,7 +26,10 @@ function isValidGitRepoUrl(gitRepoUrl: string): boolean {
|
|||
return ['https://', 'git@'].some((item) => gitRepoUrl.startsWith(item));
|
||||
}
|
||||
|
||||
async function updatePkg(pkgPath: string, obj: any): Promise<void> {
|
||||
async function updatePkg(
|
||||
pkgPath: string,
|
||||
obj: Record<string, unknown>,
|
||||
): Promise<void> {
|
||||
const content = await fs.readFile(pkgPath, 'utf-8');
|
||||
const pkg = JSON.parse(content);
|
||||
const newPkg = Object.assign(pkg, obj);
|
||||
|
@ -34,7 +37,7 @@ async function updatePkg(pkgPath: string, obj: any): Promise<void> {
|
|||
await fs.outputFile(pkgPath, JSON.stringify(newPkg, null, 2));
|
||||
}
|
||||
|
||||
export async function init(
|
||||
export default async function init(
|
||||
rootDir: string,
|
||||
siteName?: string,
|
||||
reqTemplate?: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue