Skip to content

Upgrade to ESLint v9 support with eslint-plugin-github v6 #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/great-tables-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-primer-react": major
---

Upgrade to ESLint v9 support with eslint-plugin-github v6
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const options = githubMarkdownOpinions.init({
'no-hard-tabs': false,
'first-line-heading': false,
'no-space-in-emphasis': false,
'blanks-around-fences': false
'blanks-around-fences': false,
})

module.exports = {
config: options,
customRules: ['@github/markdownlint-github'],
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]]
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]],
}
54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict'

const js = require('@eslint/js')
const globals = require('globals')
const github = require('eslint-plugin-github')

/**
* @type {import('eslint').Linter.FlatConfig[]}
*/
module.exports = [
{
ignores: ['node_modules/**', '.git/**'],
},
js.configs.recommended,
github.default.getFlatConfigs().recommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: {
...globals.commonjs,
...globals.node,
},
},
rules: {
// Override specific rules for the repository
'import/no-commonjs': 'off',
'import/no-dynamic-require': 'off', // Allow dynamic requires in tests
'no-shadow': 'off',
'no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
},
],
'github/filenames-match-regex': 'off', // Allow various file naming patterns
'i18n-text/no-en': 'off', // Allow English text in this repository
},
},
{
files: ['**/*.test.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
{
files: ['eslint.config.js'],
rules: {
'no-undef': 'off', // Allow require() in config file
},
},
]
Loading