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 8 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.

47 changes: 47 additions & 0 deletions eslint.config.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot during the migration, this file seems to hav removed extends: ['eslint:recommended', 'plugin:github/recommended'],. Can you update the config to extend from these configurations but in the new format for eslint v9?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated eslint.config.js to include both eslint:recommended and plugin:github/recommended configurations in the new flat config format for ESLint v9. The config now properly extends from these configurations using js.configs.recommended and github.default.getFlatConfigs().recommended with appropriate rule overrides for this repository. Commit: c9d0514

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict'

const globals = require('globals')

/**
* @type {import('eslint').Linter.FlatConfig[]}
*/
module.exports = [
{
ignores: ['node_modules/**', '.git/**'],
},
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: {
...globals.commonjs,
...globals.node,
},
},
rules: {
// Basic rules for the repository
'no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
},
],
'no-shadow': 'off',
'no-undef': 'error',
},
},
{
files: ['**/*.test.js'],
languageOptions: {
globals: {
...globals.jest,
},
},
},
{
files: ['eslint.config.js'],
rules: {
'no-undef': 'off', // Allow require() in config file
},
},
]
Loading