Skip to content

Commit 6bb095d

Browse files
Copilotjonrohan
andcommitted
Migrate to ESLint flat config for eslint-plugin-github 6.x compatibility
Co-authored-by: jonrohan <54012+jonrohan@users.noreply.github.com>
1 parent 31fff8a commit 6bb095d

File tree

5 files changed

+87
-42
lines changed

5 files changed

+87
-42
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import eslintPluginGithub from 'eslint-plugin-github'
2+
import globals from 'globals'
3+
4+
export default [
5+
{
6+
ignores: ['coverage/', 'node_modules/', 'dist/', '__tests__/__fixtures__/', 'rollup.config.js'],
7+
},
8+
{
9+
...eslintPluginGithub.getFlatConfigs().recommended,
10+
languageOptions: {
11+
ecmaVersion: 2023,
12+
sourceType: 'module',
13+
globals: {
14+
...globals.node,
15+
...globals.es6,
16+
},
17+
},
18+
rules: {
19+
...eslintPluginGithub.getFlatConfigs().recommended.rules,
20+
'import/no-commonjs': 'off',
21+
'github/no-then': 'off',
22+
'i18n-text/no-en': 'off',
23+
'import/extensions': ['error', 'ignorePackages'],
24+
},
25+
},
26+
{
27+
files: ['__tests__/**/*.js'],
28+
languageOptions: {
29+
globals: {
30+
...globals.jest,
31+
testRule: 'readonly',
32+
testRuleConfigs: 'readonly',
33+
},
34+
},
35+
rules: {
36+
'import/no-named-as-default-member': 'off',
37+
},
38+
},
39+
]

package-lock.json

Lines changed: 46 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@
6565
"@typescript-eslint/parser": "^8.0.1",
6666
"dedent": "^1.5.3",
6767
"eslint": "^8.57.1",
68-
"eslint-plugin-github": "^5.1.4",
68+
"eslint-plugin-github": "^6.0.0",
6969
"eslint-plugin-import": "^2.29.1",
7070
"eslint-plugin-jest": "^29.2.1",
7171
"eslint-plugin-prettier": "^5.1.3",
72+
"globals": "^17.2.0",
7273
"jest": "^30.2.0",
7374
"jest-preset-stylelint": "^8.0.0",
7475
"prettier": "^3.2.5",

0 commit comments

Comments
 (0)