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
debug(`Read content from [${chalk.yellowBright(pkgJsonDir)}]`)
const {
platforms,
packageName,
version,
binaryName,
content,
} = getNapiConfig(pkgJsonDir, cwd)
const { platforms, packageName, version, binaryName, content } =
getNapiConfig(pkgJsonDir, cwd)
for (const platformDetail of platforms) {
const targetDir = join(

View file

@ -39,13 +39,8 @@ export class PrePublishCommand extends Command {
@Command.Path('prepublish')
async execute() {
const {
packageJsonPath,
platforms,
version,
packageName,
binaryName,
} = getNapiConfig(this.configFileName)
const { packageJsonPath, platforms, version, packageName, binaryName } =
getNapiConfig(this.configFileName)
debug(`Update optionalDependencies in [${packageJsonPath}]`)
if (!this.isDryRun) {
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:armv7": "yarn --cwd ./test_module build-armv7",
"format": "run-p format:md format:json format:yaml format:source format:rs",
"format:md": "prettier --parser markdown --write './**/*.md'",
"format:json": "prettier --parser json --write './**/*.json'",
"format:md": "prettier --parser markdown --write ./**/*.md",
"format:json": "prettier --parser json --write ./**/*.json",
"format:rs": "cargo fmt",
"format:source": "prettier --config ./package.json --write './**/*.{js,ts}'",
"format:yaml": "prettier --parser yaml --write './**/*.{yml,yaml}'",
"lint": "eslint -c .eslintrc.yml './cli/**/*.ts' './test_module/**/*.{ts,js}'",
"format:source": "prettier --config ./package.json --write ./**/*.{js,ts}",
"format:yaml": "prettier --parser yaml --write ./**/*.{yml,yaml}",
"lint": "eslint -c .eslintrc.yml ./cli/**/*.ts ./test_module/**/*.{ts,js}",
"prepublishOnly": "npm run build && pinst --disable",
"test": "ava",
"postinstall": "husky install",