Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 905 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 905 Bytes

ESLint Action

This is a GitHub Action that runs ESLint for .js, .jsx, .ts and .tsx files using your .eslintrc rules. It's free to run and it'll annotate the diffs of your pull requests with lint errors and warnings.

Neat! Bet your CI doesn't do that.

Usage

.github/workflows/lint.yml:

name: Lint

on: pull_request

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: hallee/[email protected]
        # GITHUB_TOKEN in forked repositories is read-only
        # https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
        if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} 
        with:
          repo-token: ${{secrets.GITHUB_TOKEN}}
          source-root: optional-sub-dir