eslint-plugin-import-next 2.3.10 → 2.3.12

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 +6 -18
  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 -195
  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/AGENTS.md DELETED
@@ -1,95 +0,0 @@
1
- # AGENTS.md
2
-
3
- > Context for AI coding agents working on eslint-plugin-import-next
4
-
5
- ## Setup Commands
6
-
7
- ```bash
8
- # Install dependencies (from monorepo root)
9
- npm install
10
-
11
- # Build this package
12
- nx build eslint-plugin-import-next
13
-
14
- # Run tests
15
- nx test eslint-plugin-import-next
16
-
17
- # Run tests with coverage
18
- nx test eslint-plugin-import-next --coverage
19
-
20
- # Lint this package
21
- nx lint eslint-plugin-import-next
22
- ```
23
-
24
- ## Code Style
25
-
26
- - TypeScript strict mode with `@interlace/eslint-devkit` types
27
- - Use `AST_NODE_TYPES` constants, never string literals for node types
28
- - Use `formatLLMMessage()` for all rule error messages
29
- - Use `c8 ignore` comments with documented reasons for untestable code
30
- - Single-pass AST traversal patterns (O(n) complexity)
31
-
32
- ## Testing Instructions
33
-
34
- - Tests use `@typescript-eslint/rule-tester` with Vitest
35
- - Each rule has `index.ts` (implementation) and `*.test.ts` (tests) in same directory
36
- - Run specific rule test: `nx test eslint-plugin-import-next --testPathPattern="no-circular"`
37
- - Coverage target: ≥90% lines, ≥95% functions
38
- - All tests must pass before committing
39
-
40
- ## Project Structure
41
-
42
- ```
43
- src/
44
- ├── index.ts # Plugin entry, 6 configs
45
- └── rules/ # 30 rule directories
46
- └── [rule-name]/
47
- ├── index.ts # Rule implementation
48
- └── *.test.ts # Rule tests
49
- ```
50
-
51
- ## Plugin Purpose
52
-
53
- ESLint plugin for **dependency management** with 30 LLM-optimized rules. Covers module resolution, ES module enforcement, architecture boundaries, export/import style, and dependency management.
54
-
55
- ## Available Presets
56
-
57
- | Preset | Description |
58
- | ------------------- | ------------------------------------------- |
59
- | `recommended` | Balanced configuration (13 rules) |
60
- | `strict` | All 30 rules as errors |
61
- | `module-resolution` | Focus on import/export validation (7 rules) |
62
- | `import-style` | Focus on import formatting (5 rules) |
63
- | `esm` | Enforce ES Modules only (3 rules) |
64
- | `architecture` | Enforce module boundaries (6 rules) |
65
-
66
- ## Rule Categories
67
-
68
- | Category | Rules |
69
- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
- | Module Resolution | `no-unresolved`, `named`, `default`, `namespace`, `extensions`, `no-self-import`, `no-duplicates` |
71
- | Module System | `no-amd`, `no-commonjs`, `no-nodejs-modules` |
72
- | Dependency Boundaries | `no-cycle`, `no-internal-modules`, `no-cross-domain-imports`, `enforce-dependency-direction`, `no-restricted-paths`, `no-relative-parent-imports` |
73
- | Export Style | `no-default-export`, `no-named-export`, `prefer-default-export`, `no-anonymous-default-export`, `no-mutable-exports`, `no-deprecated` |
74
- | Import Style | `enforce-import-order`, `first`, `newline-after-import`, `no-unassigned-import` |
75
- | Dependency Management | `no-extraneous-dependencies`, `no-unused-modules`, `max-dependencies`, `prefer-node-protocol` |
76
-
77
- ## Common Fix Patterns
78
-
79
- ```typescript
80
- // Circular dependencies (CWE-407)
81
- // BAD: A.ts imports B.ts, B.ts imports A.ts
82
- // GOOD: Extract shared code to types.ts, break cycle
83
-
84
- // Node.js protocol
85
- // BAD: import { readFile } from 'fs'
86
- // GOOD: import { readFile } from 'node:fs'
87
-
88
- // Import order
89
- // BAD: import local from './local'; import external from 'external';
90
- // GOOD: import external from 'external'; import local from './local';
91
-
92
- // No CommonJS
93
- // BAD: const x = require('./module')
94
- // GOOD: import x from './module'
95
- ```
package/CHANGELOG.md DELETED
@@ -1,195 +0,0 @@
1
- ## [2.3.6] - 2026-05-03
2
-
3
- ## 2.3.10
4
-
5
- ### Patch Changes
6
-
7
- - [#301](https://github.com/ofri-peretz/eslint/pull/301) [`b07b8a3`](https://github.com/ofri-peretz/eslint/commit/b07b8a3da59da34969bb26a2481541464a222c84) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Correct the unmeasured "up to 100x faster" claim in the 2.0.0 CHANGELOG entry.
8
-
9
- `CHANGELOG.md` ships in this package's `files` array, so the claim was published to npm. No benchmark measures 100x: the verified figures are **3.1x faster end-to-end** and **8x faster in pure rule execution** against `eslint-plugin-import` 2.32.0 on a 5,736-file / 455K-LoC React codebase. The entry now carries an inline correction rather than a silent rewrite of release history — see `CLAIMS.md` § Withdrawn claims.
10
-
11
- Docs-only. No rule behaviour changes.
12
-
13
- - [#294](https://github.com/ofri-peretz/eslint/pull/294) [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Rewrite `description` and `keywords` on every published package for npm search discovery. npm ranks on name, description, and keywords, and the registry only picks up these fields at publish — so this is metadata-only and takes effect for each package on its next release.
14
-
15
- **Descriptions now lead with the search phrase.** Every one starts `ESLint plugin for <the thing you'd search>` instead of a brand-first or category-first framing, and names the concrete vulnerabilities the plugin actually detects. Three were corrected while doing so:
16
-
17
- - `eslint-plugin-import-next` claimed "100x faster no-cycle detection". No 100x measurement exists: `CLAIMS.md` records **3.1x end-to-end** (8x in pure rule execution) on a 5,483-file React codebase, and the highest number in any benchmark result is 54.9x on the synthetic corpus. The description now states the real-codebase figure.
18
- - `eslint-plugin-secure-coding` claimed SQL injection, XSS and CSRF coverage — none of which are its rules. It now names what it does detect: LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.
19
- - `eslint-plugin-secure-coding` ("89 rules") and `eslint-plugin-react-a11y` ("37 rules") hard-coded rule counts that had drifted from reality. Counts are generated into `interlace-numbers.json`; hand-typed copies are removed rather than corrected.
20
-
21
- **Keywords now match the vocabulary of the plugins that rank.** `eslint-plugin-security`, `eslint-plugin-jsx-a11y`, `eslint-plugin-n` and `eslint-plugin-import` all carry the `eslint` / `eslintplugin` / `eslint-plugin` trio — six of our packages were missing `eslintplugin`, and every one now carries all three plus `static-analysis`, `linting` and `code-quality`. Security plugins add `sast`, `appsec` and `vulnerability`; `node-security` and `secure-coding` also carry `nodesecurity`, the exact keyword `eslint-plugin-security` ranks on. Each plugin gained the CWE identifiers and attack names for what it detects (`cwe-78` command injection, `cwe-22` path traversal, `cwe-89` SQL injection, `cwe-79` XSS, `cwe-347` JWT algorithm confusion, `cwe-352` CSRF, `cwe-943` NoSQL injection), and `node-security` gained the crypto vocabulary it had been missing entirely despite absorbing the crypto rule set (`crypto`, `cryptography`, `weak-hash`, `md5`, `sha1`, `timing-attack`).
22
-
23
- No rule behavior, exports, or configuration changes.
24
-
25
- - Updated dependencies [[`e1cdf83`](https://github.com/ofri-peretz/eslint/commit/e1cdf83e3db761907f0ab06f7fc6c1f1da7513a5), [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358)]:
26
- - @interlace/eslint-devkit@1.4.3
27
-
28
- ## 2.3.9
29
-
30
- ### Patch Changes
31
-
32
- - [#269](https://github.com/ofri-peretz/eslint/pull/269) [`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - docs: dual-logo README header (Interlace mark + ESLint mark side by side) and closing Interlace footer — refreshes the README rendered on npmjs.com. No runtime changes.
33
-
34
- - Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
35
- - @interlace/eslint-devkit@1.4.2
36
-
37
- ## 2.3.8
38
-
39
- ### Patch Changes
40
-
41
- - [#252](https://github.com/ofri-peretz/eslint/pull/252) [`d67e395`](https://github.com/ofri-peretz/eslint/commit/d67e3953c2748ad36e6aebe0f24b1d04e518b4d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix Codecov badge showing "unknown" — switch from flag to component URL format
42
-
43
- ## 2.3.7
44
-
45
- ### Patch Changes
46
-
47
- - [#141](https://github.com/ofri-peretz/eslint/pull/141) [`38ab670`](https://github.com/ofri-peretz/eslint/commit/38ab670a0221684f4fd3d5dc3c05ddec7458ca2b) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: remove false `meta.fixable: 'code'` declarations from 21 rules that had no `fix()` function
48
-
49
- Rules that declared `fixable: 'code'` in their ESLint meta without an actual `fix()` implementation would show the ⚡ auto-fix icon in editors and CI formatters but apply no change when `--fix` was run. This patch removes the misleading declaration from:
50
- - `browser-security/no-clickjacking`
51
- - `import-next/first`, `named`, `no-barrel-import`, `no-import-module-exports`, `no-namespace`
52
- - `node-security/no-buffer-overread`, `no-unsafe-dynamic-require`, `no-zip-slip`
53
- - `react-features/react-no-inline-functions`
54
- - `reliability/no-jsdoc-terminator-in-example` (uses `suggest`, not auto-fix; corrected to `hasSuggestions: true` only)
55
- - `secure-coding/no-directive-injection`, `no-electron-security-issues`, `no-graphql-injection`, `no-improper-sanitization`, `no-improper-type-validation`, `no-ldap-injection`, `no-unchecked-loop-condition`, `no-unlimited-resource-allocation`, `no-weak-password-recovery`, `no-xpath-injection`
56
-
57
- - [#186](https://github.com/ofri-peretz/eslint/pull/186) [`edf208d`](https://github.com/ofri-peretz/eslint/commit/edf208d67ac2357312c97d8964fcf6a462e407eb) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Consolidation cleanup — no rule behavior change:
58
- - **react-features**: the README rules table now lists the 8 `componentApi`
59
- preset rules. The README generator (`sync-readme-rules.ts`) and the
60
- `plugin-rule-source-drift` validator now recurse into nested
61
- `docs/rules/<category>/` subfolders, so every documented rule is advertised
62
- consistently (previously the nested componentApi docs were silently dropped,
63
- which an earlier `readme` exception had papered over — that exception is now
64
- removed in favour of the real fix).
65
- - **node-security**: remove the orphaned `no-pii-in-logs` rule source — the rule
66
- was migrated to `eslint-plugin-secure-coding` and is no longer exported here;
67
- the dead source was still compiling into `dist`.
68
- - **import-next**: restore the `no-cycle` unit test after [#180](https://github.com/ofri-peretz/eslint/issues/180)'s SCC refactor
69
- (`computeSCCsFromFile` + `findShortestCyclePath` are now bridged in the mock).
70
-
71
- Also fixes `scripts/ilb-plugin-scope-audit.ts` to stop mis-reading config-preset
72
- keys (`'recommended-strict': {`) as rules.
73
-
74
- - Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
75
- - @interlace/eslint-devkit@1.4.1
76
-
77
- ### Changed
78
-
79
- - `no-cycle` rewritten to per-import targeted DFS (replaces upfront full-graph BFS+Tarjan SCC). The `nonCyclicFiles` cache provides O(1) rejection after first visit; only files along the actual DFS path are read. Detection parity with the previous algorithm is preserved.
80
-
81
- ## 2.3.5 (2026-02-09)
82
-
83
- This was a version bump only for eslint-plugin-import-next to align it with other projects, there were no code changes.
84
-
85
- ## [2.3.3] - 2026-02-08
86
-
87
- ### Bug Fixes
88
-
89
- - align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
90
-
91
- ### Documentation
92
-
93
- - fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
94
-
95
- ### ❤️ Thank You
96
-
97
- - Ofri Peretz
98
-
99
- ## [2.3.2] - 2026-02-06
100
-
101
- ### Bug Fixes
102
-
103
- - align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
104
-
105
- ### ❤️ Thank You
106
-
107
- - Ofri Peretz
108
-
109
- ## [2.3.1] - 2026-02-02
110
-
111
- This was a version bump only for eslint-plugin-import-next to align it with other projects, there were no code changes.
112
-
113
- # Changelog
114
-
115
- All notable changes to this project will be documented in this file.
116
-
117
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
118
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
119
-
120
- ### Documentation
121
-
122
- - 📘 Launched new documentation site: [eslint.interlace.tools](https://eslint.interlace.tools/)
123
-
124
- ## [2.0.0] - 2025-12-30
125
-
126
- ### Changed
127
-
128
- - **Architecture Overhaul**: Complete rewrite for performance and maintainability.
129
- - **Rule Parity**: Achieved 100% feature parity with `eslint-plugin-import` (46 rules).
130
- - **Performance**: `no-cycle` rule is now significantly faster using incremental graph analysis. _(Corrected 2026-08-02: this entry originally read "up to 100x faster". That number was never measured and has been withdrawn — see [CLAIMS.md](https://github.com/ofri-peretz/eslint/blob/main/CLAIMS.md). The verified figures are 3.1x faster end-to-end and 8x faster in pure rule time on a 5,736-file React codebase.)_
131
- - **TypeScript Support**: First-class support for TypeScript (parsers and resolvers) out of the box.
132
-
133
- ### Added
134
-
135
- - **New Rules**:
136
- - `prefer-node-protocol` - Enforce `node:` protocol for Node.js built-ins.
137
- - `no-named-as-default` - specialized check for named exports used as default.
138
- - `no-named-as-default-member` - Check for properties on default export that match named exports.
139
- - `no-relative-packages` - Enforce package boundaries.
140
- - `no-import-module-exports` - Disallow `module.exports` alongside imports.
141
- - `no-empty-named-blocks` - Disallow empty named import blocks.
142
- - `consistent-type-specifier-style` - Enforce type-only import style (inline vs top-level).
143
- - `no-dynamic-require` - Disallow dynamic require calls.
144
- - `no-self-import` - Detect self-referential imports.
145
- - `no-named-default` - Disallow named default exports.
146
- - `no-restricted-paths` - Enhanced path restriction rule.
147
- - `unambiguous` - Enforce unambiguous module type.
148
- - **Enhanced Documentation**: All rules now feature AEO-compliant documentation with OWASP mappings.
149
- - **Improved Testing**: Comprehensive test suite covering all rules, including edge cases and TypeScript integration.
150
-
151
- ## [1.0.0] - 2024-12-05
152
-
153
- ### Added
154
-
155
- - Initial release with 30 LLM-optimized dependency rules
156
- - **Module Resolution Rules** (7 rules):
157
- - `no-unresolved` - Ensure imports resolve to a module
158
- - `named` - Ensure named imports exist
159
- - `default` - Ensure default export exists
160
- - `namespace` - Ensure namespace imports are valid
161
- - `extensions` - Enforce file extension usage
162
- - `no-self-import` - Prevent module from importing itself
163
- - `no-duplicates` - Prevent duplicate imports
164
- - **Module System Rules** (3 rules):
165
- - `no-amd` - Disallow AMD imports
166
- - `no-commonjs` - Disallow CommonJS imports
167
- - `no-nodejs-modules` - Disallow Node.js built-in modules
168
- - **Dependency Boundaries Rules** (6 rules):
169
- - `no-cycle` - Detect circular dependency chains
170
- - `no-internal-modules` - Forbid deep/internal module imports
171
- - `no-cross-domain-imports` - Enforce domain boundaries
172
- - `enforce-dependency-direction` - Enforce layered architecture
173
- - `no-restricted-paths` - Restrict imports between paths
174
- - `no-relative-parent-imports` - Disallow `../` imports
175
- - **Export Style Rules** (6 rules):
176
- - `no-default-export` - Disallow default exports
177
- - `no-named-export` - Disallow named exports
178
- - `prefer-default-export` - Prefer default for single exports
179
- - `no-anonymous-default-export` - Disallow anonymous default exports
180
- - `no-mutable-exports` - Disallow mutable exports
181
- - `no-deprecated` - Disallow deprecated exports
182
- - **Import Style Rules** (4 rules):
183
- - `enforce-import-order` - Enforce import ordering
184
- - `first` - Ensure imports are at the top
185
- - `newline-after-import` - Require newline after imports
186
- - `no-unassigned-import` - Disallow side-effect imports
187
- - **Dependency Management Rules** (4 rules):
188
- - `no-extraneous-dependencies` - Disallow unlisted dependencies
189
- - `no-unused-modules` - Detect unused exports/modules
190
- - `max-dependencies` - Limit number of dependencies
191
- - `prefer-node-protocol` - Prefer `node:` protocol for builtins
192
- - Preset configurations: `recommended`, `strict`, `module-resolution`, `import-style`, `esm`, `architecture`
193
- - Full ESLint 9 flat config support
194
- - ESLint MCP integration for AI assistants
195
- - TypeScript type exports for all rule options
@@ -1,7 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- export default function foo(): string;
7
- export declare const bar = "baz";
@@ -1,6 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- export declare const foo = "bar";
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import { TSESLint } from '@interlace/eslint-devkit';
7
- type MessageIds = 'preferInline' | 'preferTopLevel';
8
- type Style = 'prefer-inline' | 'prefer-top-level';
9
- type RuleOptions = [Style?];
10
- export declare const consistentTypeSpecifierStyle: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
11
- name: string;
12
- };
13
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import type { TSESLint } from '@interlace/eslint-devkit';
7
- export declare const defaultRule: TSESLint.RuleModule<"noDefaultExport", [], unknown, TSESLint.RuleListener> & {
8
- name: string;
9
- };
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: dynamic-import-chunkname
8
- * Enforce a leading comment with the webpackChunkName for dynamic imports
9
- *
10
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'missingChunkName' | 'invalidChunkName' | 'suggestChunkName';
14
- export interface Options {
15
- /** Import functions to check (defaults to just dynamic import) */
16
- importFunctions?: string[];
17
- /** Allowed prefixes for chunk names */
18
- allowEmpty?: boolean;
19
- /** Pattern to validate chunk name (regex string) */
20
- webpackChunknameFormat?: string;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const dynamicImportChunkname: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: enforce-dependency-direction
8
- * Ensures dependencies flow in the correct architectural direction
9
- * Priority 2: Architectural Patterns
10
- *
11
- * @see https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- type MessageIds = 'dependencyDirectionViolation' | 'useDependencyInversion' | 'refactorDependency';
15
- export interface Options {
16
- /** Layer definitions with dependency order. Default: ['domain', 'application', 'infrastructure', 'presentation'] */
17
- layers?: string[];
18
- /** Layer directory patterns. Default: ['domain', 'application', 'infrastructure', 'presentation', 'ui', 'api'] */
19
- layerPatterns?: string[];
20
- /** Allow same-layer imports. Default: true */
21
- allowSameLayer?: boolean;
22
- }
23
- type RuleOptions = [Options?];
24
- export declare const enforceDependencyDirection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
25
- name: string;
26
- };
27
- export {};
@@ -1,29 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: enforce-import-order
8
- * Enforces a specific order for import statements
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- type MessageIds = 'importOrder' | 'alphabeticalOrder' | 'importsNotContiguous';
12
- export interface Options {
13
- /** Groups order */
14
- groups?: string[];
15
- /** Internal alias patterns (regex strings) */
16
- internalPatterns?: string[];
17
- /** Alphabetical sorting */
18
- alphabetize?: {
19
- order: 'asc' | 'desc' | 'ignore';
20
- caseInsensitive?: boolean;
21
- };
22
- /** Newline between groups */
23
- newlinesBetween?: 'always' | 'never' | 'ignore';
24
- }
25
- type RuleOptions = [Options?];
26
- export declare const enforceImportOrder: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
27
- name: string;
28
- };
29
- export {};
@@ -1,47 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: enforce-team-boundaries
8
- * Prevents unauthorized cross-team imports in large codebases
9
- *
10
- * Why This Matters:
11
- * - In large organizations (1000+ developers), uncontrolled imports lead to tight coupling
12
- * - Teams accidentally depend on internal implementation details of other teams
13
- * - Makes refactoring dangerous as changes ripple across team boundaries
14
- * - Slows down CI as changes in one team trigger tests across all dependents
15
- *
16
- * @see https://nx.dev/concepts/module-federation
17
- */
18
- import type { TSESLint } from '@interlace/eslint-devkit';
19
- /**
20
- * Team boundary configuration
21
- */
22
- interface TeamBoundary {
23
- /** Team identifier (e.g., 'platform', 'payments', 'auth') */
24
- team: string;
25
- /** Path patterns belonging to this team */
26
- paths: string[];
27
- /** Teams this team is allowed to import from */
28
- allowedDependencies?: string[];
29
- /** Shared packages anyone can import (e.g., '@company/shared') */
30
- publicPackages?: string[];
31
- }
32
- /**
33
- * Configuration options for enforce-team-boundaries rule
34
- */
35
- export interface EnforceTeamBoundariesOptions {
36
- /** Team boundary definitions */
37
- teams: TeamBoundary[];
38
- /** Global shared paths anyone can import from */
39
- sharedPaths?: string[];
40
- /** External packages (node_modules) are always allowed */
41
- allowExternalPackages?: boolean;
42
- }
43
- type RuleOptions = [EnforceTeamBoundariesOptions];
44
- export declare const enforceTeamBoundaries: TSESLint.RuleModule<"unauthorizedTeamImport", RuleOptions, unknown, TSESLint.RuleListener> & {
45
- name: string;
46
- };
47
- export {};
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: export
8
- * Forbid any invalid exports, i.e. re-export of the same name
9
- *
10
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/export.md
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'duplicateExport' | 'duplicateDefault';
14
- export declare const exportRule: TSESLint.RuleModule<MessageIds, [], unknown, TSESLint.RuleListener> & {
15
- name: string;
16
- };
17
- export {};
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: exports-last
8
- * Ensure all exports appear after other statements
9
- *
10
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export declare const exportsLast: TSESLint.RuleModule<"exportNotLast", [], unknown, TSESLint.RuleListener> & {
14
- name: string;
15
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import type { TSESLint } from '@interlace/eslint-devkit';
7
- type MessageIds = 'missingExtension' | 'unexpectedExtension';
8
- type Options = [
9
- {
10
- pattern?: Record<string, 'always' | 'never'>;
11
- default?: 'always' | 'never';
12
- }
13
- ];
14
- export declare const extensions: TSESLint.RuleModule<MessageIds, Options, unknown, TSESLint.RuleListener> & {
15
- name: string;
16
- };
17
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import type { TSESLint } from '@interlace/eslint-devkit';
7
- export interface Options {
8
- additionalModules?: string[];
9
- }
10
- export type RuleOptions = [Options?];
11
- export declare const first: TSESLint.RuleModule<"first", RuleOptions, unknown, TSESLint.RuleListener> & {
12
- name: string;
13
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: group-exports
8
- * Prefer named exports to be grouped together in a single export declaration
9
- *
10
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export declare const groupExports: TSESLint.RuleModule<"groupExports", [], unknown, TSESLint.RuleListener> & {
14
- name: string;
15
- };
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: max-dependencies
8
- * Enforce the maximum number of dependencies a module can have (eslint-plugin-import inspired)
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- type MessageIds = 'maxDependencies' | 'suggestRefactor' | 'dependencyAnalysis';
12
- export interface Options {
13
- /** Maximum number of dependencies allowed */
14
- max?: number;
15
- /** Ignore type-only imports */
16
- ignoreTypeImports?: boolean;
17
- /** Ignore specific import sources */
18
- ignoreImports?: string[];
19
- /** Ignore files matching patterns */
20
- ignoreFiles?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const maxDependencies: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import { TSESLint } from '@interlace/eslint-devkit';
7
- export interface Options {
8
- additionalModules?: string[];
9
- }
10
- export type RuleOptions = [Options?];
11
- export declare const named: TSESLint.RuleModule<"named", RuleOptions, unknown, TSESLint.RuleListener> & {
12
- name: string;
13
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import { TSESLint } from '@interlace/eslint-devkit';
7
- export interface Options {
8
- additionalModules?: string[];
9
- }
10
- export type RuleOptions = [Options?];
11
- export declare const namespace: TSESLint.RuleModule<"namespace", RuleOptions, unknown, TSESLint.RuleListener> & {
12
- name: string;
13
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- import { TSESLint } from '@interlace/eslint-devkit';
7
- export interface Options {
8
- additionalModules?: string[];
9
- }
10
- export type RuleOptions = [Options?];
11
- export declare const newlineAfterImport: TSESLint.RuleModule<"newlineAfterImport", RuleOptions, unknown, TSESLint.RuleListener> & {
12
- name: string;
13
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-absolute-path
8
- * Forbid import of modules using absolute paths
9
- *
10
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export interface Options {
14
- /** Check ES module imports. Default: true */
15
- esmodule?: boolean;
16
- /** Check CommonJS require calls. Default: true */
17
- commonjs?: boolean;
18
- /** Check AMD define/require calls. Default: false */
19
- amd?: boolean;
20
- }
21
- type RuleOptions = [Options?];
22
- export declare const noAbsolutePath: TSESLint.RuleModule<"absolutePath", RuleOptions, unknown, TSESLint.RuleListener> & {
23
- name: string;
24
- };
25
- export {};