From 098e01a48c2684cb76f3862b3f26d02b17d41c9a Mon Sep 17 00:00:00 2001 From: ryota-murakami Date: Fri, 15 Sep 2023 06:47:22 +0900 Subject: [PATCH] fix script path --- bin/cli.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cli.mjs b/bin/cli.mjs index c57179e..8255972 100755 --- a/bin/cli.mjs +++ b/bin/cli.mjs @@ -139,7 +139,8 @@ function InsertRootdirFilesPath2TSconfig() { function InseartLintFixCommand2PkgJson() { const pkgJsonPath = join(userCurrentDir, 'package.json') - const pkgJson = JSON.parse(pkgJsonPath) + const pkgJsonFile = readFileSync(pkgJsonPath, 'utf-8') + const pkgJson = JSON.parse(pkgJsonFile) pkgJson.scripts.lint = 'eslint . --ext .ts,.tsx,.js,jsx,cjs,mjs' pkgJson.scripts['lint:fix'] = 'eslint . --ext .ts,.tsx,.js,jsx,cjs,mjs --fix' writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2))