Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.
/ eslint-action Public archive
forked from gimenete/eslint-action

✨ ESLint GitHub Action with inline lint annotations for pull requests

License

Notifications You must be signed in to change notification settings

hallee/eslint-action

 
 

Repository files navigation

This repository has been abandoned

GitHub now offers a much cleaner way to handle linters with complex projects and provide annotations on PRs. The problem matcher format is now the best way to handle this.

actions/setup-node provides ESLint annotations by default now, and it is the best solution for lint annotations in PRs. See https://github.com/actions/setup-node/blob/main/.github/eslint-stylish.json as an example of the problem matcher format.

ESLint Action (abandoned)

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/eslint-action@1.0.3
        # 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

About

✨ ESLint GitHub Action with inline lint annotations for pull requests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 85.7%
  • Dockerfile 7.5%
  • Shell 6.8%