{"id":19773,"library":"eslint-plugin-github","title":"eslint-plugin-github","description":"An opinionated collection of ESLint shared configs and rules used by GitHub. Current stable version is 6.0.0, which includes flat config support and ESM-only. The package provides configs for browser, React, TypeScript, and internal GitHub applications. Key differentiators: it enforces GitHub's own coding standards, includes accessibility rules (a11y), async/await best practices, and actionable rules like array-foreach and no-then. It supports both legacy .eslintrc and flat config via getFlatConfigs().","status":"active","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/github/eslint-plugin-github","tags":["javascript"],"install":[{"cmd":"npm install eslint-plugin-github","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-github","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-github","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to use this plugin; v6 requires eslint ^8 or ^9","package":"eslint","optional":false}],"imports":[{"note":"v6.0.0 is ESM-only. CommonJS require() will fail; use dynamic import() in CommonJS if needed, or stay on v5.","wrong":"const github = require('eslint-plugin-github')","symbol":"default","correct":"import github from 'eslint-plugin-github'"},{"note":"Only available with flat config (ESLint v9). Legacy .eslintrc users should use extends: plugin:github/recommended.","wrong":"require('eslint-plugin-github').getFlatConfigs()","symbol":"github.getFlatConfigs","correct":"github.getFlatConfigs()"},{"note":"Custom rules are prefixed with github/ when using the plugin. For example, github/async-preventdefault, github/no-then, github/a11y-aria-label-is-well-formatted.","wrong":"'array-foreach': 'error'","symbol":"Rule: github/array-foreach","correct":"'github/array-foreach': 'error'"}],"quickstart":{"code":"npm install --save-dev eslint eslint-plugin-github\n\n# Create eslint.config.js (ESM flat config)\nimport github from 'eslint-plugin-github'\n\nexport default [\n  github.getFlatConfigs().recommended,\n  github.getFlatConfigs().browser,\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]","lang":"typescript","description":"Shows flat config usage with recommended, browser, react, typescript configs and custom rules."},"warnings":[{"fix":"Upgrade to Node 20 or later, or continue using v5.x (legacy CommonJS).","message":"v6.0.0 is ESM-only. Requires Node >= 20.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Explicitly add rules from removed plugin if needed. See changelog for details.","message":"v6.0.0 removed github plugin from typescript config; previously included rules may no longer apply.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Update rule name from 'filenames/match-regex' to 'github/filenames-match-regex'.","message":"filenames/match-regex rule renamed to github/filenames-match-regex (the original eslint-filenames-plugin is unmaintained).","severity":"deprecated","affected_versions":">=5.1.3"},{"fix":"Prefix custom rules with 'github/'.","message":"When using flat config, plugin namespace must be explicit in rule names (e.g., 'github/array-foreach'), not just 'array-foreach'.","severity":"gotcha","affected_versions":">=5.1.0"},{"fix":"Add 'settings.github.components' mapping and 'settings.github.polymorphicPropName' in your ESLint config.","message":"The react config requires a component mapping setting for polymorphic components; otherwise some a11y rules may not apply correctly.","severity":"gotcha","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use dynamic import() or set type: module in package.json. Alternatively, downgrade to v5.x.","cause":"v6.0.0 is ESM-only; CommonJS require() fails.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-github/dist/index.js from .../eslint.config.js not supported. Instead rename the index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change the required code to use ESM."},{"fix":"Change 'array-foreach' to 'github/array-foreach' in your ESLint config.","cause":"Rule name missing plugin prefix 'github/'.","error":"Definition for rule 'array-foreach' was not found."},{"fix":"Install with npm install --save-dev eslint-plugin-github, and import it at the top of eslint.config.js.","cause":"Plugin not installed or not added to plugins array in flat config.","error":"ESLint couldn't find the plugin 'eslint-plugin-github'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}