Skip to content

Run ESLint

Actions
Run ESLint on JavaScript files
1.0.2
Latest
Star (87)

GitHub ESLint runner

This action executes ESLint linter on specified javascript files without any previous action/build step or Docker required.

Prerequisites

ESLint

You must have the ESLint running locally for the action to execute. It will use the same rules as you do locally. More info on the ESLint getting started guide

Usage

main.workflow

Add to your existing main.workflow file or create a new file named .github/workflow/lint.yml and copy over one of the examples below to your new workflow file

This is the simplest example to get it running:

name: Lint

on: [push]

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      name: ESLint
        - uses: stefanoeb/[email protected]

By default it will run ESLint through all the files in the project. But you can also specify a glob of files to lint using the with: argument on your YAML file. The example below shows ESLint running only on the files under the src/ folder:

name: Lint

on: [push]

jobs:
  eslint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      name: ESLint
        - uses: stefanoeb/[email protected]
        with:
          files: src/

If there is no previous step installing the necessary modules, this action will execute a yarn install or npm install automatically.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Run ESLint is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run ESLint on JavaScript files
1.0.2
Latest

Run ESLint is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.