eslint-plugin-import-next 2.3.9 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +47 -0
  2. package/package.json +16 -12
  3. package/src/files/foo.js +0 -5
  4. package/src/files/no-default.js +0 -5
  5. package/src/index.d.ts +15 -2812
  6. package/src/index.js +5 -147
  7. package/src/oxlint.d.ts +17 -20
  8. package/src/oxlint.js +0 -18
  9. package/src/rules/consistent-type-specifier-style.js +0 -19
  10. package/src/rules/default.js +0 -7
  11. package/src/rules/dynamic-import-chunkname.js +0 -8
  12. package/src/rules/enforce-dependency-direction.js +2 -39
  13. package/src/rules/enforce-import-order.js +3 -33
  14. package/src/rules/enforce-team-boundaries.js +0 -49
  15. package/src/rules/export.js +0 -9
  16. package/src/rules/exports-last.js +0 -10
  17. package/src/rules/extensions.js +2 -11
  18. package/src/rules/first.js +0 -6
  19. package/src/rules/group-exports.js +0 -13
  20. package/src/rules/max-dependencies.js +0 -16
  21. package/src/rules/named.js +1 -10
  22. package/src/rules/namespace.js +1 -11
  23. package/src/rules/newline-after-import.js +2 -13
  24. package/src/rules/no-absolute-path.js +0 -7
  25. package/src/rules/no-amd.js +1 -18
  26. package/src/rules/no-anonymous-default-export.js +0 -13
  27. package/src/rules/no-barrel-file.js +0 -32
  28. package/src/rules/no-barrel-import.js +0 -25
  29. package/src/rules/no-commonjs.js +0 -18
  30. package/src/rules/no-cross-domain-imports.js +2 -47
  31. package/src/rules/no-cycle.js +2 -135
  32. package/src/rules/no-default-export.js +0 -28
  33. package/src/rules/no-deprecated.js +0 -32
  34. package/src/rules/no-duplicates.js +2 -10
  35. package/src/rules/no-dynamic-require.js +0 -6
  36. package/src/rules/no-empty-named-blocks.js +1 -17
  37. package/src/rules/no-extraneous-dependencies.js +0 -38
  38. package/src/rules/no-full-package-import.js +0 -19
  39. package/src/rules/no-import-module-exports.js +0 -8
  40. package/src/rules/no-internal-modules.js +0 -40
  41. package/src/rules/no-legacy-imports.js +1 -11
  42. package/src/rules/no-mutable-exports.js +0 -14
  43. package/src/rules/no-named-as-default-member.js +0 -11
  44. package/src/rules/no-named-as-default.js +0 -17
  45. package/src/rules/no-named-default.js +0 -5
  46. package/src/rules/no-named-export.js +1 -22
  47. package/src/rules/no-namespace.js +0 -10
  48. package/src/rules/no-nodejs-modules.js +0 -15
  49. package/src/rules/no-relative-packages.js +0 -15
  50. package/src/rules/no-relative-parent-imports.js +0 -11
  51. package/src/rules/no-restricted-paths.js +0 -6
  52. package/src/rules/no-self-import.js +0 -22
  53. package/src/rules/no-unassigned-import.js +0 -14
  54. package/src/rules/no-unresolved.js +0 -16
  55. package/src/rules/no-unused-modules.js +0 -7
  56. package/src/rules/no-useless-path-segments.js +0 -15
  57. package/src/rules/prefer-default-export.js +0 -18
  58. package/src/rules/prefer-direct-import.js +1 -21
  59. package/src/rules/prefer-modern-api.js +0 -21
  60. package/src/rules/prefer-node-protocol.js +0 -15
  61. package/src/rules/prefer-tree-shakeable-imports.js +0 -14
  62. package/src/rules/require-import-approval.js +0 -21
  63. package/src/rules/unambiguous.js +0 -11
  64. package/src/types/index.js +0 -5
  65. package/AGENTS.md +0 -95
  66. package/CHANGELOG.md +0 -170
  67. package/src/files/foo.d.ts +0 -7
  68. package/src/files/no-default.d.ts +0 -6
  69. package/src/rules/consistent-type-specifier-style.d.ts +0 -13
  70. package/src/rules/default.d.ts +0 -9
  71. package/src/rules/dynamic-import-chunkname.d.ts +0 -26
  72. package/src/rules/enforce-dependency-direction.d.ts +0 -27
  73. package/src/rules/enforce-import-order.d.ts +0 -29
  74. package/src/rules/enforce-team-boundaries.d.ts +0 -47
  75. package/src/rules/export.d.ts +0 -17
  76. package/src/rules/exports-last.d.ts +0 -15
  77. package/src/rules/extensions.d.ts +0 -17
  78. package/src/rules/first.d.ts +0 -13
  79. package/src/rules/group-exports.d.ts +0 -15
  80. package/src/rules/max-dependencies.d.ts +0 -26
  81. package/src/rules/named.d.ts +0 -13
  82. package/src/rules/namespace.d.ts +0 -13
  83. package/src/rules/newline-after-import.d.ts +0 -13
  84. package/src/rules/no-absolute-path.d.ts +0 -25
  85. package/src/rules/no-amd.d.ts +0 -21
  86. package/src/rules/no-anonymous-default-export.d.ts +0 -24
  87. package/src/rules/no-barrel-file.d.ts +0 -55
  88. package/src/rules/no-barrel-import.d.ts +0 -48
  89. package/src/rules/no-commonjs.d.ts +0 -28
  90. package/src/rules/no-cross-domain-imports.d.ts +0 -41
  91. package/src/rules/no-cycle.d.ts +0 -102
  92. package/src/rules/no-default-export.d.ts +0 -24
  93. package/src/rules/no-deprecated.d.ts +0 -26
  94. package/src/rules/no-duplicates.d.ts +0 -13
  95. package/src/rules/no-dynamic-require.d.ts +0 -22
  96. package/src/rules/no-empty-named-blocks.d.ts +0 -17
  97. package/src/rules/no-extraneous-dependencies.d.ts +0 -45
  98. package/src/rules/no-full-package-import.d.ts +0 -42
  99. package/src/rules/no-import-module-exports.d.ts +0 -21
  100. package/src/rules/no-internal-modules.d.ts +0 -28
  101. package/src/rules/no-legacy-imports.d.ts +0 -47
  102. package/src/rules/no-mutable-exports.d.ts +0 -22
  103. package/src/rules/no-named-as-default-member.d.ts +0 -15
  104. package/src/rules/no-named-as-default.d.ts +0 -15
  105. package/src/rules/no-named-default.d.ts +0 -15
  106. package/src/rules/no-named-export.d.ts +0 -26
  107. package/src/rules/no-namespace.d.ts +0 -21
  108. package/src/rules/no-nodejs-modules.d.ts +0 -24
  109. package/src/rules/no-relative-packages.d.ts +0 -21
  110. package/src/rules/no-relative-parent-imports.d.ts +0 -22
  111. package/src/rules/no-restricted-paths.d.ts +0 -20
  112. package/src/rules/no-self-import.d.ts +0 -15
  113. package/src/rules/no-unassigned-import.d.ts +0 -20
  114. package/src/rules/no-unresolved.d.ts +0 -20
  115. package/src/rules/no-unused-modules.d.ts +0 -19
  116. package/src/rules/no-useless-path-segments.d.ts +0 -23
  117. package/src/rules/prefer-default-export.d.ts +0 -24
  118. package/src/rules/prefer-direct-import.d.ts +0 -51
  119. package/src/rules/prefer-modern-api.d.ts +0 -47
  120. package/src/rules/prefer-node-protocol.d.ts +0 -19
  121. package/src/rules/prefer-tree-shakeable-imports.d.ts +0 -49
  122. package/src/rules/require-import-approval.d.ts +0 -52
  123. package/src/rules/unambiguous.d.ts +0 -15
package/README.md CHANGED
@@ -59,6 +59,53 @@ npm install eslint-plugin-import-next --save-dev
59
59
  | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------- | :----------------------- |
60
60
  | All Rules | [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import) [![npm](https://img.shields.io/npm/v/eslint-plugin-import.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-import) | ✅ Supported | Full drop-in replacement |
61
61
 
62
+ ## 🧬 Deep dependency graphs
63
+
64
+ `import/no-cycle` **crashes** on deep import chains. `import-next/no-cycle` does not.
65
+
66
+ Cycle detection is a strongly-connected-components pass over your module graph. Done recursively — one JavaScript stack frame per module — a chain deeper than the engine's call stack throws `RangeError: Maximum call stack size exceeded`. ESLint then exits 2 with **no results at all**: not a slow lint, no lint. Both rules default to unlimited traversal depth, so nothing caps the descent.
67
+
68
+ `import-next` runs the same traversal on an explicit stack, so its ceiling is heap rather than stack.
69
+
70
+ ### See it yourself
71
+
72
+ ```bash
73
+ npm i -D eslint eslint-plugin-import eslint-plugin-import-next
74
+ curl -O https://raw.githubusercontent.com/ofri-peretz/eslint/main/benchmarks/scripts/repro-deep-chain.mjs
75
+ node repro-deep-chain.mjs 6000
76
+ ```
77
+
78
+ ```text
79
+ chain depth: 6000 modules
80
+
81
+ eslint-plugin-import FAILED after 93.6s — RangeError: Error while loading rule 'import/no-cycle': Maximum call stack size exceeded
82
+ eslint-plugin-import-next completed in 18.2s
83
+ ```
84
+
85
+ Measured on Node 24 / darwin-arm64 with ESLint 10.7. The exact depth at which the recursive implementation dies varies with Node version and platform stack size — around 5,000 modules here.
86
+
87
+ ### Chains get deep by accident
88
+
89
+ Hand-written 5,000-module chains are rare. These are not:
90
+
91
+ - generated clients and schema bindings, where each type re-exports the next
92
+ - barrel files (`index.ts`) re-exporting barrels, several layers down
93
+ - long `export … from` ladders in a monorepo's shared packages
94
+
95
+ Depth accumulates through re-export edges, which is exactly what the rule follows.
96
+
97
+ ### Speed, for completeness
98
+
99
+ Across graph shapes at 5,000 files each, `import-next` is ~1.1× faster on dense cyclic graphs and on cold single-file runs, and ties on graphs with no cycles to find. The wide/shallow shape is **unresolved** — two runs disagree (0.8× sequential, 1.01× interleaved) and the machine has not been quiet enough to settle it, so no claim is made there. On a real 455K-line React codebase it is **8× faster in rule time** and 3.1× end-to-end at 100% detection parity.
100
+
101
+ Speed is the smaller story. The deep-chain result above is a difference in kind, not degree.
102
+
103
+ Detection parity is checked per shape before any timing is trusted, and every number comes from a committed result file:
104
+
105
+ - [`benchmarks/results/ilb-perf-import-shapes/`](https://github.com/ofri-peretz/eslint/tree/main/benchmarks/results/ilb-perf-import-shapes)
106
+ - [`benchmarks/results/ilb-perf-import-no-cycle/`](https://github.com/ofri-peretz/eslint/tree/main/benchmarks/results/ilb-perf-import-no-cycle)
107
+ - [methodology](https://github.com/ofri-peretz/eslint/blob/main/benchmarks/suites/ilb-perf-import/methodology.md)
108
+
62
109
  ## 📦 Compatibility
63
110
  | Package | Version |
64
111
  | :--- | :--- |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-import-next",
3
- "version": "2.3.9",
4
- "description": "Drop-in replacement for eslint-plugin-import. 100x faster no-cycle detection, AI-optimized fixes, zero config migration.",
3
+ "version": "2.3.11",
4
+ "description": "ESLint plugin for imports and module boundaries — drop-in replacement for eslint-plugin-import, 3.1x faster end-to-end, zero-config migration.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
7
7
  "types": "./src/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "homepage": "https://eslint.interlace.tools/docs/quality/plugin-import-next?utm_source=npm&utm_medium=referral&utm_campaign=eslint-plugin-import-next",
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "https://github.com/ofri-peretz/eslint",
27
+ "url": "git+https://github.com/ofri-peretz/eslint.git",
28
28
  "directory": "packages/eslint-plugin-import-next"
29
29
  },
30
30
  "bugs": {
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "files": [
37
37
  "src/",
38
- "dist/",
39
38
  "README.md",
40
- "LICENSE",
41
- "CHANGELOG.md",
42
- "AGENTS.md"
39
+ "LICENSE"
43
40
  ],
44
41
  "keywords": [
45
42
  "eslint",
46
- "eslint-plugin",
47
43
  "eslintplugin",
44
+ "eslint-plugin",
45
+ "static-analysis",
46
+ "linting",
47
+ "code-quality",
48
48
  "interlace-quality",
49
49
  "eslint-plugin-import",
50
50
  "eslint-plugin-import-alternative",
@@ -52,16 +52,19 @@
52
52
  "imports",
53
53
  "no-cycle",
54
54
  "circular-dependencies",
55
+ "dependency-graph",
55
56
  "import-order",
57
+ "barrel-file",
58
+ "tree-shaking",
59
+ "monorepo",
56
60
  "modules",
57
61
  "module-resolution",
58
62
  "commonjs",
59
63
  "esm",
60
64
  "llm-optimized",
61
65
  "ai-assistant",
62
- "auto-fix",
63
66
  "typescript",
64
- "static-analysis",
67
+ "auto-fix",
65
68
  "mcp",
66
69
  "agentic"
67
70
  ],
@@ -73,7 +76,8 @@
73
76
  },
74
77
  "dependencies": {
75
78
  "tslib": "^2.3.0",
76
- "@interlace/eslint-devkit": "^1.4.2"
79
+ "@interlace/eslint-devkit": "^1.6.0",
80
+ "oxc-resolver": "^11.24.2"
77
81
  },
78
82
  "devDependencies": {
79
83
  "@typescript-eslint/parser": "^8.46.2",
@@ -87,6 +91,6 @@
87
91
  },
88
92
  "funding": {
89
93
  "type": "github",
90
- "url": "https://github.com/ofri-peretz/eslint"
94
+ "url": "git+https://github.com/ofri-peretz/eslint.git"
91
95
  }
92
96
  }
package/src/files/foo.js CHANGED
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2025 Ofri Peretz
4
- * Licensed under the MIT License. Use of this source code is governed by the
5
- * MIT license that can be found in the LICENSE file.
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
8
3
  exports.bar = void 0;
9
4
  exports.default = foo;
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2025 Ofri Peretz
4
- * Licensed under the MIT License. Use of this source code is governed by the
5
- * MIT license that can be found in the LICENSE file.
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
8
3
  exports.foo = void 0;
9
4
  exports.foo = 'bar';