style: apply latest prettier and eslint rules

This commit is contained in:
LongYinan 2021-05-13 23:41:49 +08:00
parent b01dae728b
commit 22099972d2
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
3 changed files with 9 additions and 19 deletions

View file

@ -24,13 +24,8 @@ export class CreateNpmDirCommand extends Command {
) => { ) => {
const pkgJsonDir = config const pkgJsonDir = config
debug(`Read content from [${chalk.yellowBright(pkgJsonDir)}]`) debug(`Read content from [${chalk.yellowBright(pkgJsonDir)}]`)
const { const { platforms, packageName, version, binaryName, content } =
platforms, getNapiConfig(pkgJsonDir, cwd)
packageName,
version,
binaryName,
content,
} = getNapiConfig(pkgJsonDir, cwd)
for (const platformDetail of platforms) { for (const platformDetail of platforms) {
const targetDir = join( const targetDir = join(

View file

@ -39,13 +39,8 @@ export class PrePublishCommand extends Command {
@Command.Path('prepublish') @Command.Path('prepublish')
async execute() { async execute() {
const { const { packageJsonPath, platforms, version, packageName, binaryName } =
packageJsonPath, getNapiConfig(this.configFileName)
platforms,
version,
packageName,
binaryName,
} = getNapiConfig(this.configFileName)
debug(`Update optionalDependencies in [${packageJsonPath}]`) debug(`Update optionalDependencies in [${packageJsonPath}]`)
if (!this.isDryRun) { if (!this.isDryRun) {
await VersionCommand.updatePackageJson(this.prefix, this.configFileName) await VersionCommand.updatePackageJson(this.prefix, this.configFileName)

View file

@ -18,12 +18,12 @@
"build:test:android": "yarn --cwd ./test_module build --target aarch64-linux-android", "build:test:android": "yarn --cwd ./test_module build --target aarch64-linux-android",
"build:test:armv7": "yarn --cwd ./test_module build-armv7", "build:test:armv7": "yarn --cwd ./test_module build-armv7",
"format": "run-p format:md format:json format:yaml format:source format:rs", "format": "run-p format:md format:json format:yaml format:source format:rs",
"format:md": "prettier --parser markdown --write './**/*.md'", "format:md": "prettier --parser markdown --write ./**/*.md",
"format:json": "prettier --parser json --write './**/*.json'", "format:json": "prettier --parser json --write ./**/*.json",
"format:rs": "cargo fmt", "format:rs": "cargo fmt",
"format:source": "prettier --config ./package.json --write './**/*.{js,ts}'", "format:source": "prettier --config ./package.json --write ./**/*.{js,ts}",
"format:yaml": "prettier --parser yaml --write './**/*.{yml,yaml}'", "format:yaml": "prettier --parser yaml --write ./**/*.{yml,yaml}",
"lint": "eslint -c .eslintrc.yml './cli/**/*.ts' './test_module/**/*.{ts,js}'", "lint": "eslint -c .eslintrc.yml ./cli/**/*.ts ./test_module/**/*.{ts,js}",
"prepublishOnly": "npm run build && pinst --disable", "prepublishOnly": "npm run build && pinst --disable",
"test": "ava", "test": "ava",
"postinstall": "husky install", "postinstall": "husky install",