Registry / testing / eslint-plugin-github

eslint-plugin-github

JSON →
library6.0.0jsnpmunverified

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().

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

v6.0.0 is ESM-only. CommonJS require() will fail; use dynamic import() in CommonJS if needed, or stay on v5.

import github from 'eslint-plugin-github'

Only available with flat config (ESLint v9). Legacy .eslintrc users should use extends: plugin:github/recommended.

github.getFlatConfigs()

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.

'github/array-foreach': 'error'

Shows flat config usage with recommended, browser, react, typescript configs and custom rules.

npm install --save-dev eslint eslint-plugin-github # Create eslint.config.js (ESM flat config) import github from 'eslint-plugin-github' export default [ github.getFlatConfigs().recommended, github.getFlatConfigs().browser, github.getFlatConfigs().react, ...github.getFlatConfigs().typescript, { files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'], ignores: ['eslint.config.mjs'], rules: { 'github/array-foreach': 'error', 'github/async-preventdefault': 'warn', 'github/no-then': 'error', 'github/no-blur': 'error', }, }, ]
Debug
Known footguns
breakingv6.0.0 is ESM-only. Requires Node >= 20.
breakingv6.0.0 removed github plugin from typescript config; previously included rules may no longer apply.
deprecatedfilenames/match-regex rule renamed to github/filenames-match-regex (the original eslint-filenames-plugin is unmaintained).
gotchaWhen using flat config, plugin namespace must be explicit in rule names (e.g., 'github/array-foreach'), not just 'array-foreach'.
gotchaThe react config requires a component mapping setting for polymorphic components; otherwise some a11y rules may not apply correctly.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bingbot
1
Resources