Add check-format script and update lint-js.yml (#2357)

* chore: Add check-format script to package.json for code formatting consistency

* chore: Update lint-js.yml to use npm run check-format instead of npm run format
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-25 14:46:51 -07:00
commit 340df293ba
2 changed files with 4 additions and 7 deletions

View file

@ -45,10 +45,6 @@ jobs:
- name: Run Prettier
run: |
cd src/frontend
npm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply Prettier formatting
branch: ${{ github.head_ref }}
npm run check-format

View file

@ -83,6 +83,7 @@
"build": "vite build",
"serve": "vite preview",
"format": "npx prettier --write \"{tests,src}/**/*.{js,jsx,ts,tsx,json,md}\" --ignore-path .prettierignore",
"check-format": "npx prettier --check \"{tests,src}/**/*.{js,jsx,ts,tsx,json,md}\" --ignore-path .prettierignore",
"type-check": "tsc --noEmit --pretty --project tsconfig.json && vite"
},
"eslintConfig": {
@ -132,4 +133,4 @@
"ua-parser-js": "^1.0.38",
"vite": "^5.3.1"
}
}
}