Skip to content
align-center

GitHub Action

ESLint Code Lint & Fix

v1.0.0 Latest version

ESLint Code Lint & Fix

align-center

ESLint Code Lint & Fix

Run ESLint on your source code from GitHub workflows

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ESLint Code Lint & Fix

uses: permafrost-dev/[email protected]

Learn more about this action in permafrost-dev/eslint-docker-ga

Choose a version

eslint-docker-ga

Run ESLint on your source code from GitHub workflows

Sample Github workflow (this assumes there is a .eslintrc.js file in your repository):

name: Check & fix styling (eslint)

on:
  push:

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Run ESLint
        uses: permafrost-dev/eslint-docker-ga@main
        with:
          args: --fix ./src/**/*

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Fix styling

Use a preset configuration by either NOT specifying the --config option in args, or by specifying --typescript to use the TypeScript configuration.

name: Check & fix styling (eslint)

on:
  push:

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Run ESLint
        uses: permafrost-dev/eslint-docker-ga@main
        with:
          args: --typescript --fix ./src/**/*

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Fix styling

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.