[Linter] Fix errors #228
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint code using eslint on push | |
| on: | |
| push | |
| jobs: | |
| run_eslint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.ref }} | |
| persist-credentials: true | |
| - name: Cache node modules | |
| id: cache-npm | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Install packages | |
| run: npm install | |
| - name: Run eslint | |
| run: npm run lint-fix | |
| - name: Run type-check | |
| run: npm run type-check | |
| - name: Push changes back to repository | |
| uses: stefanzweifel/git-auto-commit-action@v7 # or actions/ for my gitea | |
| with: | |
| commit_message: "${{ github.event.head_commit.message }} - formatted by Eslint [skip ci]" |