Run ESLint on either all files or selectively run ESLint on only changed files in a pull request with support for inline annotations of ESLint Warnings & Errors.
- Easy to debug
- Fast execution
- Fix ESlint errors
- Glob pattern extension filtering
- Excludes ignored files from change detection.
- Inline annotations of ESLint Warnings & Errors.
- Inline annotations with possible resolutions that can be applied to the Pull Request.
- Monorepo support.
...:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install dependencies
run: npm ci # OR: yarn
- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v23
with:
config_path: "/path/to/.eslintrc"
ignore_path: "/path/to/.eslintignore"
extra_args: "--max-warnings=0"
For more working examples view the test.yml
If you feel generous and want to show some extra appreciation:
Support this project with a ⭐
- uses: tj-actions/eslint-changed-files@v23
id: eslint-changed-files
with:
# Run [ESlint](https://eslint.org) on all matching files.
# Type: boolean
# Default: "false"
all_files: ''
# [ESlint](https://eslint.org/) [configuration file](https://eslint.org/docs/user-guide/configuring/). Optionally omit this input for Mono repositories.
# Type: string
config_path: ''
# Extra arguments passed to [ESlint](https://eslint.org/docs/user-guide/command-line-interface)
# Type: string
extra_args: ''
# Exit code for reviewdog when errors are found.
# Type: boolean
# Default: "true"
fail_on_error: ''
# List of file extensions to watch for changes and
# run [ESlint](https://eslint.org/) against.
# Type: string
# Default: **/*.{ts,tsx,js,jsx}
#
file_extensions: ''
# [Filter mode](https://github.com/reviewdog/reviewdog#filter-mode) for the reviewdog command (added, diff_context, file, nofilter).
# Type: string
# Default: "added"
filter_mode: ''
# [ESlint](https://eslint.org/) [ignore file](https://eslint.org/docs/user-guide/configuring/ignoring-code)
# Type: string
ignore_path: ''
# Report level for reviewdog (info,warning,error)
# Type: string
# Default: "error"
level: ''
# Relative path under GITHUB_WORKSPACE to the repository
# Type: string
# Default: "."
path: ''
# [Reporter](https://github.com/reviewdog/reviewdog#reporters) of reviewdog command (github-check, github-pr-review). github-pr-review can use Markdown
# and add a link to rule page in reviewdog
# reports.
# Type: string
# Default: "github-pr-review"
reporter: ''
# Skip running reviewdog i.e don't add any annotations.
# Type: boolean
# Default: "false"
skip_annotations: ''
# [GITHUB TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) or a repo scoped [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token)
# Type: string
# Default: "${{ github.token }}"
token: ''
- Free software: MIT license
Thanks goes to these wonderful people (emoji key):
Clinton Blackburn 💻 |
Sava Vidakovic 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!