Skip to content

Commit b948539

Browse files
committed
Use import-x/no-cycle
1 parent c545315 commit b948539

15 files changed

+524
-18
lines changed

eslint.config.mjs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { fixupPluginRules } from "@eslint/compat";
22
import github from "eslint-plugin-github";
3+
import { importX, createNodeResolver } from "eslint-plugin-import-x";
4+
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
35
import noAsyncForeach from "eslint-plugin-no-async-foreach";
46
import jsdoc from "eslint-plugin-jsdoc";
57
import tseslint from "typescript-eslint";
@@ -29,8 +31,14 @@ export default [
2931
// Type-checked rules from typescript-eslint (the github plugin only
3032
// includes the base recommended rules, not the type-checked ones).
3133
...tseslint.configs.recommendedTypeCheckedOnly,
34+
// import-x TypeScript settings (parsers, extensions, external-module-folders).
35+
// This is needed for import-x rules to properly parse TypeScript files.
36+
{
37+
settings: importX.flatConfigs.typescript.settings,
38+
},
3239
{
3340
plugins: {
41+
"import-x": importX,
3442
"no-async-foreach": fixupPluginRules(noAsyncForeach),
3543
"jsdoc": jsdoc,
3644
},
@@ -57,6 +65,12 @@ export default [
5765
typescript: {},
5866
},
5967
"import/ignore": ["sinon", "uuid", "@octokit/plugin-retry", "del", "get-folder-size"],
68+
"import-x/resolver-next": [
69+
createTypeScriptImportResolver(),
70+
createNodeResolver({
71+
extensions: [".ts", ".js", ".json"],
72+
}),
73+
],
6074
},
6175

6276
rules: {
@@ -72,7 +86,10 @@ export default [
7286

7387
"import/no-amd": "error",
7488
"import/no-commonjs": "error",
75-
"import/no-cycle": "error",
89+
// import/no-cycle does not seem to work with ESLint 9.
90+
// Use import-x/no-cycle from eslint-plugin-import-x instead.
91+
"import/no-cycle": "off",
92+
"import-x/no-cycle": "error",
7693
"import/no-dynamic-require": "error",
7794

7895
"import/no-extraneous-dependencies": [

lib/analyze-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)