{"id":13617654,"url":"https://github.com/github/eslint-plugin-github","last_synced_at":"2025-05-14T14:08:10.543Z","repository":{"id":8207606,"uuid":"54927600","full_name":"github/eslint-plugin-github","owner":"github","description":"An opinionated collection of ESLint rules used by GitHub.","archived":false,"fork":false,"pushed_at":"2025-05-05T16:43:00.000Z","size":2871,"stargazers_count":314,"open_issues_count":12,"forks_count":59,"subscribers_count":218,"default_branch":"main","last_synced_at":"2025-05-05T17:58:29.843Z","etag":null,"topics":["eslint","eslintplugin","javascript"],"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/github.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-03-28T22:20:22.000Z","updated_at":"2025-05-05T16:43:01.000Z","dependencies_parsed_at":"2023-12-19T02:25:40.774Z","dependency_job_id":"0976a38c-f1d7-49d2-8693-b2dc5338a82f","html_url":"https://github.com/github/eslint-plugin-github","commit_stats":{"total_commits":1033,"total_committers":43,"mean_commits":"24.023255813953487","dds":0.7182962245885769,"last_synced_commit":"dd7aef3629d5e49e592b5d7d5a0cc21978794eef"},"previous_names":[],"tags_count":127,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Feslint-plugin-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Feslint-plugin-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Feslint-plugin-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Feslint-plugin-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/eslint-plugin-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253436709,"owners_count":21908391,"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","eslintplugin","javascript"],"created_at":"2024-08-01T20:01:45.493Z","updated_at":"2025-05-14T14:08:10.521Z","avatar_url":"https://github.com/github.png","language":"JavaScript","readme":"# eslint-plugin-github\n\n## Installation\n\n```sh\nnpm install --save-dev eslint eslint-plugin-github\n```\n\n## Setup\n\n### Legacy Configuration (`.eslintrc`)\n\nAdd `github` to your list of plugins in your ESLint config.\n\nJSON ESLint config example:\n\n```json\n{\n  \"plugins\": [\"github\"]\n}\n```\n\nExtend the configs you wish to use.\n\nJSON ESLint config example:\n\n```json\n{\n  \"extends\": [\"plugin:github/recommended\"]\n}\n```\n\n### Flat Configuration (`eslint-config.js`)\n\nImport the `eslint-plugin-github`, and extend any of the configurations using `getFlatConfigs()` as needed like so:\n\n```js\nimport github from 'eslint-plugin-github'\n\nexport default [\n  github.getFlatConfigs().browser,\n  github.getFlatConfigs().recommended,\n  github.getFlatConfigs().react,\n  ...github.getFlatConfigs().typescript,\n  {\n    files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],\n    ignores: ['eslint.config.mjs'],\n    rules: {\n      'github/array-foreach': 'error',\n      'github/async-preventdefault': 'warn',\n      'github/no-then': 'error',\n      'github/no-blur': 'error',\n    },\n  },\n]\n```\n\n\u003e [!NOTE]\n\u003e If you configured the `filenames/match-regex` rule, please note we have adapted the match regex rule into `eslint-plugin-github` as the original `eslint-filenames-plugin` is no longer maintained and needed a flat config support update. \n\u003e \n\u003e Please update the name to `github/filenames-match-regex`, and note, the default rule is kebab case or camelCase with one hump. For custom configuration, such as matching for camelCase regex, here's an example:\n\u003e\n\u003e `'github/filenames-match-regex': ['error', '^([a-z0-9]+)([A-Z][a-z0-9]+)*$'],`\n\nThe available configs are:\n\n- `internal`\n  - Rules useful for github applications.\n- `browser`\n  - Useful rules when shipping your app to the browser.\n- `react`\n  - Recommended rules for React applications.\n- `recommended`\n  - Recommended rules for every application.\n- `typescript`\n  - Useful rules when writing TypeScript.\n\n### Component mapping (Experimental)\n\n_Note: This is experimental and subject to change._\n\nThe `react` config includes rules which target specific HTML elements. You may provide a mapping of custom components to an HTML element in your `eslintrc` configuration to increase linter coverage.\n\nBy default, these eslint rules will check the \"as\" prop for underlying element changes. If your repo uses a different prop name for polymorphic components provide the prop name in your `eslintrc` configuration under `polymorphicPropName`.\n\n```json\n{\n  \"settings\": {\n    \"github\": {\n      \"polymorphicPropName\": \"asChild\",\n      \"components\": {\n        \"Box\": \"p\",\n        \"Link\": \"a\"\n      }\n    }\n  }\n}\n```\n\nThis config will be interpreted in the following way:\n\n- All `\u003cBox\u003e` elements will be treated as a `p` element type.\n- `\u003cLink\u003e` without a defined `as` prop will be treated as a `a`.\n- `\u003cLink as='button'\u003e` will be treated as a `button` element type.\n\n### Rules\n\n\u003c!-- begin auto-generated rules list --\u003e\n\n💼 Configurations enabled in.\\\n🔍 Set in the `browser` configuration.\\\n🔐 Set in the `internal` configuration.\\\n⚛️ Set in the `react` configuration.\\\n✅ Set in the `recommended` configuration.\\\n🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\\\n❌ Deprecated.\n\n| Name                                                                                                     | Description                                                                                                              | 💼 | 🔧 | ❌  |\n| :------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |\n| [a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md)                     | enforce [aria-label] text to be formatted as you would visual text.                                                      | ⚛️ |    |    |\n| [a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md)                                     | disallow generic link text                                                                                               |    |    | ❌  |\n| [a11y-no-title-attribute](docs/rules/a11y-no-title-attribute.md)                                         | disallow using the title attribute                                                                                       | ⚛️ |    |    |\n| [a11y-no-visually-hidden-interactive-element](docs/rules/a11y-no-visually-hidden-interactive-element.md) | enforce that interactive elements are not visually hidden                                                                | ⚛️ |    |    |\n| [a11y-role-supports-aria-props](docs/rules/a11y-role-supports-aria-props.md)                             | enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ |    |    |\n| [a11y-svg-has-accessible-name](docs/rules/a11y-svg-has-accessible-name.md)                               | require SVGs to have an accessible name                                                                                  | ⚛️ |    |    |\n| [array-foreach](docs/rules/array-foreach.md)                                                             | enforce `for..of` loops over `Array.forEach`                                                                             | ✅  |    |    |\n| [async-currenttarget](docs/rules/async-currenttarget.md)                                                 | disallow `event.currentTarget` calls inside of async functions                                                           | 🔍 |    |    |\n| [async-preventdefault](docs/rules/async-preventdefault.md)                                               | disallow `event.preventDefault` calls inside of async functions                                                          | 🔍 |    |    |\n| [authenticity-token](docs/rules/authenticity-token.md)                                                   | disallow usage of CSRF tokens in JavaScript                                                                              | 🔐 |    |    |\n| [filenames-match-regex](docs/rules/filenames-match-regex.md)                                             | require filenames to match a regex naming convention                                                                     |    |    |    |\n| [get-attribute](docs/rules/get-attribute.md)                                                             | disallow wrong usage of attribute names                                                                                  | 🔍 | 🔧 |    |\n| [js-class-name](docs/rules/js-class-name.md)                                                             | enforce a naming convention for js- prefixed classes                                                                     | 🔐 |    |    |\n| [no-blur](docs/rules/no-blur.md)                                                                         | disallow usage of `Element.prototype.blur()`                                                                             | 🔍 |    |    |\n| [no-d-none](docs/rules/no-d-none.md)                                                                     | disallow usage the `d-none` CSS class                                                                                    | 🔐 |    |    |\n| [no-dataset](docs/rules/no-dataset.md)                                                                   | enforce usage of `Element.prototype.getAttribute` instead of `Element.prototype.datalist`                                | 🔍 |    |    |\n| [no-dynamic-script-tag](docs/rules/no-dynamic-script-tag.md)                                             | disallow creating dynamic script tags                                                                                    | ✅  |    |    |\n| [no-implicit-buggy-globals](docs/rules/no-implicit-buggy-globals.md)                                     | disallow implicit global variables                                                                                       | ✅  |    |    |\n| [no-inner-html](docs/rules/no-inner-html.md)                                                             | disallow `Element.prototype.innerHTML` in favor of `Element.prototype.textContent`                                       | 🔍 |    |    |\n| [no-innerText](docs/rules/no-innerText.md)                                                               | disallow `Element.prototype.innerText` in favor of `Element.prototype.textContent`                                       | 🔍 | 🔧 |    |\n| [no-then](docs/rules/no-then.md)                                                                         | enforce using `async/await` syntax over Promises                                                                         | ✅  |    |    |\n| [no-useless-passive](docs/rules/no-useless-passive.md)                                                   | disallow marking a event handler as passive when it has no effect                                                        | 🔍 | 🔧 |    |\n| [prefer-observers](docs/rules/prefer-observers.md)                                                       | disallow poorly performing event listeners                                                                               | 🔍 |    |    |\n| [require-passive-events](docs/rules/require-passive-events.md)                                           | enforce marking high frequency event handlers as passive                                                                 | 🔍 |    |    |\n| [unescaped-html-literal](docs/rules/unescaped-html-literal.md)                                           | disallow unescaped HTML literals                                                                                         | 🔍 |    |    |\n\n\u003c!-- end auto-generated rules list --\u003e\n","funding_links":[],"categories":["Plugins","JavaScript"],"sub_categories":["Code Quality"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Feslint-plugin-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Feslint-plugin-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Feslint-plugin-github/lists"}