From 9594cb0d8a2041f4a932eeb16e44076bbec84849 Mon Sep 17 00:00:00 2001 From: Yiqing Zhu <793831308@qq.com> Date: Wed, 7 Jun 2023 22:10:25 +1000 Subject: [PATCH] Modify Update package.json scripts --- .github/workflows/vite-react-ts-setup.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vite-react-ts-setup.yml b/.github/workflows/vite-react-ts-setup.yml index adb44ba..5f0749d 100644 --- a/.github/workflows/vite-react-ts-setup.yml +++ b/.github/workflows/vite-react-ts-setup.yml @@ -30,7 +30,13 @@ jobs: - name: Update package.json scripts run: | - npx json -I -f package.json -e 'this.scripts.prettier="prettier \\"src/**/*.{js,jsx,ts,tsx,css,scss,md}\\" --write"; this.scripts["format:check"]="yarn prettier -- --check"; this.scripts["format:write"]="yarn prettier -- --write"; this.scripts["types:check"]="tsc --noEmit --pretty"; this.scripts.lint="eslint --ext .js,.jsx,.ts,.tsx src --no-error-on-unmatched-pattern"; this.scripts["lint:fix"]="eslint --ext .js,.jsx,.ts,.tsx src --fix --no-error-on-unmatched-pattern"; this.scripts.fix="yarn format:write && yarn lint:fix";' + echo $(jq '.scripts.prettier="prettier \"src/**/*.{js,jsx,ts,tsx,css,scss,md}\" --write"' package.json) > package.json + echo $(jq '.scripts["format:check"]="yarn prettier -- --check"' package.json) > package.json + echo $(jq '.scripts["format:write"]="yarn prettier -- --write"' package.json) > package.json + echo $(jq '.scripts["types:check"]="tsc --noEmit --pretty"' package.json) > package.json + echo $(jq '.scripts.lint="eslint --ext .js,.jsx,.ts,.tsx src --no-error-on-unmatched-pattern"' package.json) > package.json + echo $(jq '.scripts["lint:fix"]="eslint --ext .js,.jsx,.ts,.tsx src --fix --no-error-on-unmatched-pattern"' package.json) > package.json + echo $(jq '.scripts.fix="yarn format:write && yarn lint:fix"' package.json) > package.json - name: Commit and Push run: |