lint-frontend.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
  2. name: Lint Frontend (run `./bw-dev stylelint` to fix css errors)
  3. on:
  4. push:
  5. branches: [ main, ci, frontend ]
  6. paths:
  7. - '.github/workflows/**'
  8. - 'static/**'
  9. - '.eslintrc'
  10. - '.stylelintrc.js'
  11. pull_request:
  12. branches: [ main, ci, frontend ]
  13. jobs:
  14. lint:
  15. name: Lint with stylelint and ESLint.
  16. runs-on: ubuntu-20.04
  17. steps:
  18. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
  19. - uses: actions/checkout@v3
  20. - name: Install modules
  21. run: npm install stylelint stylelint-config-recommended stylelint-config-standard stylelint-order eslint
  22. # See .stylelintignore for files that are not linted.
  23. # - name: Run stylelint
  24. # run: >
  25. # npx stylelint bookwyrm/static/css/*.scss bookwyrm/static/css/bookwyrm/**/*.scss \
  26. # --config dev-tools/.stylelintrc.js
  27. # See .eslintignore for files that are not linted.
  28. - name: Run ESLint
  29. run: >
  30. npx eslint bookwyrm/static \
  31. --ext .js,.jsx,.ts,.tsx