Modify Update package.json scripts

main
Yiqing Zhu 2023-06-07 22:10:25 +10:00
parent 41bc8df40a
commit 9594cb0d8a
1 changed files with 7 additions and 1 deletions

View File

@ -30,7 +30,13 @@ jobs:
- name: Update package.json scripts - name: Update package.json scripts
run: | 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 - name: Commit and Push
run: | run: |