{"id":18932261,"url":"https://github.com/bradennapier/eslint-plus-action","last_synced_at":"2025-04-15T16:33:44.212Z","repository":{"id":38174180,"uuid":"272753829","full_name":"bradennapier/eslint-plus-action","owner":"bradennapier","description":"ESLint via Github Actions on changed files with annotations \u0026 comments","archived":true,"fork":false,"pushed_at":"2023-01-06T09:05:11.000Z","size":3759,"stargazers_count":39,"open_issues_count":36,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T15:17:15.835Z","etag":null,"topics":["eslint","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradennapier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-16T16:07:36.000Z","updated_at":"2024-12-03T11:18:20.000Z","dependencies_parsed_at":"2023-02-05T18:31:40.948Z","dependency_job_id":null,"html_url":"https://github.com/bradennapier/eslint-plus-action","commit_stats":{"total_commits":130,"total_committers":6,"mean_commits":"21.666666666666668","dds":"0.22307692307692306","last_synced_commit":"972d934f4b5b41945c4f489dc49717c80eb8be4c"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradennapier%2Feslint-plus-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradennapier%2Feslint-plus-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradennapier%2Feslint-plus-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradennapier%2Feslint-plus-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradennapier","download_url":"https://codeload.github.com/bradennapier/eslint-plus-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061157,"owners_count":21206459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","typescript"],"created_at":"2024-11-08T11:48:35.168Z","updated_at":"2025-04-15T16:33:43.634Z","avatar_url":"https://github.com/bradennapier.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"docs/img/annotation.png\" width=\"100%\" title=\"eslint-plus-action\"\u003e\n  \u003c/p\u003e\n  \u003cbr /\u003e\n  \u003ch1\u003e\n      eslint-plus-action\n  \u003c/h1\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003csup\u003e\n    A flexible and dead simple Github Action which runs ESLint against the changed files in a PR with customizable options and rich summaries.  ESLint issues are annotated inline on your PR diff.\n  \u003c/sup\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n![lint](https://github.com/bradennapier/eslint-plus-action/workflows/lint/badge.svg)\n\n## Dead Simple\n\nAs easy as the following, and even the more advanced features are just a few extra lines.\n\n```yml\nname: \"my-workflow\"\non: [pull_request]\n\njobs:\n  eslint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - uses: bradennapier/eslint-plus-action@v3.4.2\n```\n\n## Features\n\n- :tada: [**Works on Forked PR's Securely!**](https://github.com/bradennapier/eslint-plus-action#handle-forked-prs) :tada:\n- [Inline Annotations of ESLint Warnings \u0026 Errors](https://github.com/bradennapier/eslint-plus-action/pull/3/files)\n- Customizable ESLint options\n- [Optional summary comments on each push to the PR](https://github.com/bradennapier/eslint-plus-action/pull/3)\n- [Links to the rule documentation when available](https://github.com/bradennapier/eslint-plus-action/pull/3#issuecomment-646635983)\n- [Annotation Summary Page](https://github.com/bradennapier/eslint-plus-action/pull/3/checks?check_run_id=788235048)\n- Suggestions are printed when enabled (not yet provided as change suggestions)\n- Button to run ESLint Fix [COMING SOON]\n- More...\n\n\u003e The summary comments have some redundancy when there are suggestions available.  This will be improved.\n\n\u003e The `fix` property is not yet setup but will come shortly. If fixes are available, it will render an action button to run the fix as well.\n\n## Configuration\n\nYou provide configuration properties within your workflow by using the `with` property.  See the `Simple Workflow Example` for an example of providing your github-token.  \n\n\u003e `array` types are expected to be comma-separated values\n\n### General Configuration Properties\n\n|    Property   | Type | Default | Required | Description |\n| ------------- | ---- | ------- | -------- | ----------- |\n| github-token | string | secrets.GITHUB_TOKEN | false | Your Github token. You only need to provide this if you want to use something other than `secrets.GITHUB_TOKEN` |\n| issueSummary | boolean | true | false | Should the bot provide a summary of the results as a comment? |\n| issueSummaryType | string | compact | false | Changes the PR comment to be \"full\" (as shown on actions page) or \"compact\" |\n| issueSummaryMethod | string | edit | false | When issueSummary is enabled, allows having the bot edit or refresh the comment on each new push, can be 'edit' or 'refresh' |\n| issueSummaryOnlyOnEvent | boolean | false | false | Only provide the issue summary comment if there are warnings or errors present? |\n| annotateWarnings | boolean | true | false | By setting this to \"false\", only errors will be annotated |\n| reportSuggestions | boolean | true | false | Report suggestions when available within the annotations? |\n| reportIgnoredFiles | boolean | false | false | Report a list of any ignored files? |\n| reportWarningsAsErrors | boolean | false | false | Report any eslint warnings as errors? |\n| extensions | array | .js,.jsx,.ts,.tsx | false | An array of extensions to lint |\n| includeGlob | array | \\*\\*/\\* | false | Optional array of globs to include from the changed files list |\n| ignoreGlob | array | none | false | Optional array of globs to ignore from the changed files list |\n| configFile | string | none | false | A config file to use if the default config resolution doesn't work. |\n| rulePaths | array | none | false | Optional paths to custom rules directories to include. |\n| errorOnUnmatchedPattern | boolean | false | false | Throw error if unmatched pattern is seen? |\n| useEslintrc | boolean | true | false | Use eslintrc? |\n| useEslintIgnore | boolean | true | false | Use eslintignore? |\n| fix | boolean | false | false | Commit fixes when possible (UNFINISHED) |\n| npmInstall | boolean | false | false | Force run npm ci (or yarn) for you. If you do not use this option, be sure to install the project dependencies before running this action.  By default it will run if a node_modules directory is not found or this is set to true |\n\n\u003e The official settings can always be seen by viewing the [`action.yml`](https://github.com/bradennapier/eslint-plus-action/blob/master/action.yml) schema for the action.\n\n## Handle Forked PRs\n\nGitHub Actions only have read permissions when a forked PR is opened.  However, we can work around this by setting up a scheduled job in our workflow.  This runs at your given interval and will automatically enable serialization of results as workflow artifacts when required.  Since these will **always run against our master branch**, we can safely run our results without concern that the fork has modified the workflow in any way which may be malicious.\n\nEach time the schedule job runs it will run through any new artifacts and update the PR with the results like normal.  *If a job hasn't been detected in the last 24 hours then the action will no longer save artifacts.*  This is so you do not needlessly use up your data storage.\n\n\u003e Note that we delete the artifacts as soon as they have been processed so they will\n\u003e not use up your storage for very long.\n\n\u003e You can optionally add additional optimization by also making sure to run this action\n\u003e on the `[closed]` event so that we can cleanup all the artifacts when this occurs.\n\n\u003cbr /\u003e\n\n\u003e The scheduler will not start running until you have pushed the workflow to your main \n\u003e branch (`master`).  If it still does not run you can try pushing an empty commit, it \n\u003e seems that is sometimes required `git commit --allow-empty -m 'redeploy schedule action'`\n\n```yml\nname: \"lint\"\non: \n  # by adding a schedule task to this workflow we will automatically\n  # begin serializing read-only runs and handling them. The cron job\n  # below is set to run every 15 minutes, GitHub will ignore anything\n  # under 10 minutes and run every 10 minutes anyway.\n  schedule:\n    - cron: '*/15 * * * *'\n  pull_request:\n    types:\n      - opened\n      - synchronize\n      - closed\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - uses: bradennapier/eslint-plus-action@v3.4.2\n```\n\n## Examples\n\n### Simple Workflow Example\n\nBelow is a basic example which should get you going.  You can view the action.yml to see what other properties are available for customization.\n\n```yml\nname: \"my-workflow\"\non: [pull_request]\n\njobs:\n  eslint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - uses: bradennapier/eslint-plus-action@v3.4.2\n```\n\n### Environment Variables\n\nThere may be times that you need to provide a `NPM_TOKEN` so that the action can install your private repos.  You do this by adding the secret to your repo `Settings -\u003e Secrets` then providing it as an environment variable to the action:\n\n```yml\njobs:\n  eslint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - uses: bradennapier/eslint-plus-action@v3.4.2\n      env:\n        NPM_TOKEN: ${{secrets.NPM_TOKEN}}\n```\n\n### Providing Parameters\n\n```yml\njobs:\n  eslint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - uses: bradennapier/eslint-plus-action@v3.4.2\n      env:\n        NPM_TOKEN: ${{secrets.NPM_TOKEN}}\n      with: \n        issueSummaryType: full\n        reportIgnoredFiles: true\n```\n\n## More Previews\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/img/prcomment.png\" width=\"100%\" title=\"eslint-plus-action-pr-comment\"\u003e\n\u003c/p\u003e\n\n## Credits\n\nThis action was adapted from other actions which didn't quite work for me but were close.  So special thanks to them for helping me get here.\n\n- https://github.com/marketplace/actions/eslint-annotate\n- https://github.com/marketplace/actions/eslint-action\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradennapier%2Feslint-plus-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradennapier%2Feslint-plus-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradennapier%2Feslint-plus-action/lists"}