Skip to content

Commit 31bb101

Browse files
committed
chore: update eslint packages and config
1 parent 43f298a commit 31bb101

File tree

3 files changed

+3
-56
lines changed

3 files changed

+3
-56
lines changed

eslint.config.mjs

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
11
// @ts-check
22

3-
import { fixupPluginRules } from "@eslint/compat";
4-
import { FlatCompat } from "@eslint/eslintrc";
53
import jsEslint from "@eslint/js";
64
import eslintConfigPrettier from "eslint-config-prettier";
7-
import eslintPluginImportX from "eslint-plugin-import-x";
5+
import * as eslintPluginImportX from "eslint-plugin-import-x";
86
import * as tsEslint from "typescript-eslint";
97

10-
const compat = new FlatCompat({
11-
baseDirectory: import.meta.dirname,
12-
recommendedConfig: jsEslint.configs.recommended,
13-
allConfig: jsEslint.configs.all,
14-
});
15-
16-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
17-
/**
18-
* @param {string} name the pugin name
19-
* @param {string} alias the plugin alias
20-
* @returns {import("eslint").ESLint.Plugin}
21-
*/
22-
function legacyPlugin(name, alias = name) {
23-
const plugin = compat.plugins(name)[0]?.plugins?.[alias];
24-
25-
if (!plugin) {
26-
throw new Error(`Unable to resolve plugin ${name} and/or alias ${alias}`);
27-
}
28-
29-
return fixupPluginRules(plugin);
30-
}
31-
/* eslint-enable @typescript-eslint/explicit-function-return-type */
32-
338
export default tsEslint.config(
349
jsEslint.configs.recommended,
3510
eslintPluginImportX.flatConfigs.recommended,
@@ -56,10 +31,6 @@ export default tsEslint.config(
5631
],
5732
},
5833
{
59-
plugins: {
60-
github: legacyPlugin("eslint-plugin-github", "github"), // pending https://github.com/github/eslint-plugin-github/issues/513
61-
import: legacyPlugin("eslint-plugin-import", "import"), // Needed for above
62-
},
6334
rules: {
6435
"@typescript-eslint/await-thenable": "warn",
6536
"@typescript-eslint/explicit-function-return-type": "warn",
@@ -80,19 +51,15 @@ export default tsEslint.config(
8051
allowNumber: true,
8152
},
8253
],
83-
"github/array-foreach": "error",
84-
"github/no-implicit-buggy-globals": "error",
85-
"github/no-then": "error",
86-
"github/no-dynamic-script-tag": "error",
87-
"import/no-extraneous-dependencies": [
54+
"import-x/no-extraneous-dependencies": [
8855
"error",
8956
{
9057
devDependencies: true,
9158
optionalDependencies: true,
9259
peerDependencies: true,
9360
},
9461
],
95-
"import/order": [
62+
"import-x/order": [
9663
"warn",
9764
{ "newlines-between": "always", alphabetize: { order: "asc" } },
9865
],

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@
3232
"@actions/github": "^6.0.0"
3333
},
3434
"devDependencies": {
35-
"@eslint/compat": "^1.2.9",
36-
"@eslint/eslintrc": "^3.3.1",
3735
"@eslint/js": "^9.26.0",
3836
"@opentf/std": "^0.13.0",
3937
"@total-typescript/ts-reset": "^0.6.1",
40-
"@types/eslint__js": "^9.14.0",
4138
"@types/node": "^20.17.32",
4239
"@typescript-eslint/eslint-plugin": "^8.32.0",
4340
"@typescript-eslint/parser": "^8.32.0",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)