Skip to content

Commit 52f3be6

Browse files
Copilotjonrohanjoshblack
authored
Upgrade to ESLint v9 support with eslint-plugin-github v6 (#381)
* Initial plan * Initial analysis for ESLint v9 upgrade Co-authored-by: jonrohan <[email protected]> * Upgrade to ESLint v9 support Co-authored-by: jonrohan <[email protected]> * Update eslint-plugin-github to v6.0.0 Co-authored-by: jonrohan <[email protected]> * Format fix * Remove duplicate test cases * Remove duplicate output * Upgrade eslint-plugin-primer-react to major version * Fix eslint.config.js to include eslint:recommended and plugin:github/recommended configs and update typescript-eslint parser usage Co-authored-by: joshblack <[email protected]> * Update ESLint peerDependency to require only v9.0.0 Co-authored-by: jonrohan <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jonrohan <[email protected]> Co-authored-by: Jon Rohan <[email protected]> Co-authored-by: Jon Rohan <[email protected]> Co-authored-by: joshblack <[email protected]>
1 parent 6362adf commit 52f3be6

27 files changed

+2577
-8529
lines changed

.changeset/great-tables-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-primer-react": major
3+
---
4+
5+
Upgrade to ESLint v9 support with eslint-plugin-github v6

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

.markdownlint-cli2.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const options = githubMarkdownOpinions.init({
1616
'no-hard-tabs': false,
1717
'first-line-heading': false,
1818
'no-space-in-emphasis': false,
19-
'blanks-around-fences': false
19+
'blanks-around-fences': false,
2020
})
2121

2222
module.exports = {
2323
config: options,
2424
customRules: ['@github/markdownlint-github'],
25-
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]]
25+
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]],
2626
}

eslint.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'use strict'
2+
3+
const js = require('@eslint/js')
4+
const globals = require('globals')
5+
const github = require('eslint-plugin-github')
6+
7+
/**
8+
* @type {import('eslint').Linter.FlatConfig[]}
9+
*/
10+
module.exports = [
11+
{
12+
ignores: ['node_modules/**', '.git/**'],
13+
},
14+
js.configs.recommended,
15+
github.default.getFlatConfigs().recommended,
16+
{
17+
languageOptions: {
18+
ecmaVersion: 'latest',
19+
sourceType: 'commonjs',
20+
globals: {
21+
...globals.commonjs,
22+
...globals.node,
23+
},
24+
},
25+
rules: {
26+
// Override specific rules for the repository
27+
'import/no-commonjs': 'off',
28+
'import/no-dynamic-require': 'off', // Allow dynamic requires in tests
29+
'no-shadow': 'off',
30+
'no-unused-vars': [
31+
'error',
32+
{
33+
varsIgnorePattern: '^_',
34+
},
35+
],
36+
'github/filenames-match-regex': 'off', // Allow various file naming patterns
37+
'i18n-text/no-en': 'off', // Allow English text in this repository
38+
},
39+
},
40+
{
41+
files: ['**/*.test.js'],
42+
languageOptions: {
43+
globals: {
44+
...globals.jest,
45+
},
46+
},
47+
},
48+
{
49+
files: ['eslint.config.js'],
50+
rules: {
51+
'no-undef': 'off', // Allow require() in config file
52+
},
53+
},
54+
]

0 commit comments

Comments
 (0)