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.
- package/README.md +47 -0
- package/package.json +16 -12
- package/src/files/foo.js +0 -5
- package/src/files/no-default.js +0 -5
- package/src/index.d.ts +15 -2812
- package/src/index.js +5 -147
- package/src/oxlint.d.ts +17 -20
- package/src/oxlint.js +0 -18
- package/src/rules/consistent-type-specifier-style.js +0 -19
- package/src/rules/default.js +0 -7
- package/src/rules/dynamic-import-chunkname.js +0 -8
- package/src/rules/enforce-dependency-direction.js +2 -39
- package/src/rules/enforce-import-order.js +3 -33
- package/src/rules/enforce-team-boundaries.js +0 -49
- package/src/rules/export.js +0 -9
- package/src/rules/exports-last.js +0 -10
- package/src/rules/extensions.js +2 -11
- package/src/rules/first.js +0 -6
- package/src/rules/group-exports.js +0 -13
- package/src/rules/max-dependencies.js +0 -16
- package/src/rules/named.js +1 -10
- package/src/rules/namespace.js +1 -11
- package/src/rules/newline-after-import.js +2 -13
- package/src/rules/no-absolute-path.js +0 -7
- package/src/rules/no-amd.js +1 -18
- package/src/rules/no-anonymous-default-export.js +0 -13
- package/src/rules/no-barrel-file.js +0 -32
- package/src/rules/no-barrel-import.js +0 -25
- package/src/rules/no-commonjs.js +0 -18
- package/src/rules/no-cross-domain-imports.js +2 -47
- package/src/rules/no-cycle.js +2 -135
- package/src/rules/no-default-export.js +0 -28
- package/src/rules/no-deprecated.js +0 -32
- package/src/rules/no-duplicates.js +2 -10
- package/src/rules/no-dynamic-require.js +0 -6
- package/src/rules/no-empty-named-blocks.js +1 -17
- package/src/rules/no-extraneous-dependencies.js +0 -38
- package/src/rules/no-full-package-import.js +0 -19
- package/src/rules/no-import-module-exports.js +0 -8
- package/src/rules/no-internal-modules.js +0 -40
- package/src/rules/no-legacy-imports.js +1 -11
- package/src/rules/no-mutable-exports.js +0 -14
- package/src/rules/no-named-as-default-member.js +0 -11
- package/src/rules/no-named-as-default.js +0 -17
- package/src/rules/no-named-default.js +0 -5
- package/src/rules/no-named-export.js +1 -22
- package/src/rules/no-namespace.js +0 -10
- package/src/rules/no-nodejs-modules.js +0 -15
- package/src/rules/no-relative-packages.js +0 -15
- package/src/rules/no-relative-parent-imports.js +0 -11
- package/src/rules/no-restricted-paths.js +0 -6
- package/src/rules/no-self-import.js +0 -22
- package/src/rules/no-unassigned-import.js +0 -14
- package/src/rules/no-unresolved.js +0 -16
- package/src/rules/no-unused-modules.js +0 -7
- package/src/rules/no-useless-path-segments.js +0 -15
- package/src/rules/prefer-default-export.js +0 -18
- package/src/rules/prefer-direct-import.js +1 -21
- package/src/rules/prefer-modern-api.js +0 -21
- package/src/rules/prefer-node-protocol.js +0 -15
- package/src/rules/prefer-tree-shakeable-imports.js +0 -14
- package/src/rules/require-import-approval.js +0 -21
- package/src/rules/unambiguous.js +0 -11
- package/src/types/index.js +0 -5
- package/AGENTS.md +0 -95
- package/CHANGELOG.md +0 -170
- package/src/files/foo.d.ts +0 -7
- package/src/files/no-default.d.ts +0 -6
- package/src/rules/consistent-type-specifier-style.d.ts +0 -13
- package/src/rules/default.d.ts +0 -9
- package/src/rules/dynamic-import-chunkname.d.ts +0 -26
- package/src/rules/enforce-dependency-direction.d.ts +0 -27
- package/src/rules/enforce-import-order.d.ts +0 -29
- package/src/rules/enforce-team-boundaries.d.ts +0 -47
- package/src/rules/export.d.ts +0 -17
- package/src/rules/exports-last.d.ts +0 -15
- package/src/rules/extensions.d.ts +0 -17
- package/src/rules/first.d.ts +0 -13
- package/src/rules/group-exports.d.ts +0 -15
- package/src/rules/max-dependencies.d.ts +0 -26
- package/src/rules/named.d.ts +0 -13
- package/src/rules/namespace.d.ts +0 -13
- package/src/rules/newline-after-import.d.ts +0 -13
- package/src/rules/no-absolute-path.d.ts +0 -25
- package/src/rules/no-amd.d.ts +0 -21
- package/src/rules/no-anonymous-default-export.d.ts +0 -24
- package/src/rules/no-barrel-file.d.ts +0 -55
- package/src/rules/no-barrel-import.d.ts +0 -48
- package/src/rules/no-commonjs.d.ts +0 -28
- package/src/rules/no-cross-domain-imports.d.ts +0 -41
- package/src/rules/no-cycle.d.ts +0 -102
- package/src/rules/no-default-export.d.ts +0 -24
- package/src/rules/no-deprecated.d.ts +0 -26
- package/src/rules/no-duplicates.d.ts +0 -13
- package/src/rules/no-dynamic-require.d.ts +0 -22
- package/src/rules/no-empty-named-blocks.d.ts +0 -17
- package/src/rules/no-extraneous-dependencies.d.ts +0 -45
- package/src/rules/no-full-package-import.d.ts +0 -42
- package/src/rules/no-import-module-exports.d.ts +0 -21
- package/src/rules/no-internal-modules.d.ts +0 -28
- package/src/rules/no-legacy-imports.d.ts +0 -47
- package/src/rules/no-mutable-exports.d.ts +0 -22
- package/src/rules/no-named-as-default-member.d.ts +0 -15
- package/src/rules/no-named-as-default.d.ts +0 -15
- package/src/rules/no-named-default.d.ts +0 -15
- package/src/rules/no-named-export.d.ts +0 -26
- package/src/rules/no-namespace.d.ts +0 -21
- package/src/rules/no-nodejs-modules.d.ts +0 -24
- package/src/rules/no-relative-packages.d.ts +0 -21
- package/src/rules/no-relative-parent-imports.d.ts +0 -22
- package/src/rules/no-restricted-paths.d.ts +0 -20
- package/src/rules/no-self-import.d.ts +0 -15
- package/src/rules/no-unassigned-import.d.ts +0 -20
- package/src/rules/no-unresolved.d.ts +0 -20
- package/src/rules/no-unused-modules.d.ts +0 -19
- package/src/rules/no-useless-path-segments.d.ts +0 -23
- package/src/rules/prefer-default-export.d.ts +0 -24
- package/src/rules/prefer-direct-import.d.ts +0 -51
- package/src/rules/prefer-modern-api.d.ts +0 -47
- package/src/rules/prefer-node-protocol.d.ts +0 -19
- package/src/rules/prefer-tree-shakeable-imports.d.ts +0 -49
- package/src/rules/require-import-approval.d.ts +0 -52
- 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,170 +0,0 @@
|
|
|
1
|
-
## [2.3.6] - 2026-05-03
|
|
2
|
-
|
|
3
|
-
## 2.3.9
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- [#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.
|
|
8
|
-
|
|
9
|
-
- Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
|
|
10
|
-
- @interlace/eslint-devkit@1.4.2
|
|
11
|
-
|
|
12
|
-
## 2.3.8
|
|
13
|
-
|
|
14
|
-
### Patch Changes
|
|
15
|
-
|
|
16
|
-
- [#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
|
|
17
|
-
|
|
18
|
-
## 2.3.7
|
|
19
|
-
|
|
20
|
-
### Patch Changes
|
|
21
|
-
|
|
22
|
-
- [#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
|
|
23
|
-
|
|
24
|
-
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:
|
|
25
|
-
- `browser-security/no-clickjacking`
|
|
26
|
-
- `import-next/first`, `named`, `no-barrel-import`, `no-import-module-exports`, `no-namespace`
|
|
27
|
-
- `node-security/no-buffer-overread`, `no-unsafe-dynamic-require`, `no-zip-slip`
|
|
28
|
-
- `react-features/react-no-inline-functions`
|
|
29
|
-
- `reliability/no-jsdoc-terminator-in-example` (uses `suggest`, not auto-fix; corrected to `hasSuggestions: true` only)
|
|
30
|
-
- `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`
|
|
31
|
-
|
|
32
|
-
- [#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:
|
|
33
|
-
- **react-features**: the README rules table now lists the 8 `componentApi`
|
|
34
|
-
preset rules. The README generator (`sync-readme-rules.ts`) and the
|
|
35
|
-
`plugin-rule-source-drift` validator now recurse into nested
|
|
36
|
-
`docs/rules/<category>/` subfolders, so every documented rule is advertised
|
|
37
|
-
consistently (previously the nested componentApi docs were silently dropped,
|
|
38
|
-
which an earlier `readme` exception had papered over — that exception is now
|
|
39
|
-
removed in favour of the real fix).
|
|
40
|
-
- **node-security**: remove the orphaned `no-pii-in-logs` rule source — the rule
|
|
41
|
-
was migrated to `eslint-plugin-secure-coding` and is no longer exported here;
|
|
42
|
-
the dead source was still compiling into `dist`.
|
|
43
|
-
- **import-next**: restore the `no-cycle` unit test after [#180](https://github.com/ofri-peretz/eslint/issues/180)'s SCC refactor
|
|
44
|
-
(`computeSCCsFromFile` + `findShortestCyclePath` are now bridged in the mock).
|
|
45
|
-
|
|
46
|
-
Also fixes `scripts/ilb-plugin-scope-audit.ts` to stop mis-reading config-preset
|
|
47
|
-
keys (`'recommended-strict': {`) as rules.
|
|
48
|
-
|
|
49
|
-
- Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
|
|
50
|
-
- @interlace/eslint-devkit@1.4.1
|
|
51
|
-
|
|
52
|
-
### Changed
|
|
53
|
-
|
|
54
|
-
- `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.
|
|
55
|
-
|
|
56
|
-
## 2.3.5 (2026-02-09)
|
|
57
|
-
|
|
58
|
-
This was a version bump only for eslint-plugin-import-next to align it with other projects, there were no code changes.
|
|
59
|
-
|
|
60
|
-
## [2.3.3] - 2026-02-08
|
|
61
|
-
|
|
62
|
-
### Bug Fixes
|
|
63
|
-
|
|
64
|
-
- align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
|
|
65
|
-
|
|
66
|
-
### Documentation
|
|
67
|
-
|
|
68
|
-
- fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
|
|
69
|
-
|
|
70
|
-
### ❤️ Thank You
|
|
71
|
-
|
|
72
|
-
- Ofri Peretz
|
|
73
|
-
|
|
74
|
-
## [2.3.2] - 2026-02-06
|
|
75
|
-
|
|
76
|
-
### Bug Fixes
|
|
77
|
-
|
|
78
|
-
- align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
|
|
79
|
-
|
|
80
|
-
### ❤️ Thank You
|
|
81
|
-
|
|
82
|
-
- Ofri Peretz
|
|
83
|
-
|
|
84
|
-
## [2.3.1] - 2026-02-02
|
|
85
|
-
|
|
86
|
-
This was a version bump only for eslint-plugin-import-next to align it with other projects, there were no code changes.
|
|
87
|
-
|
|
88
|
-
# Changelog
|
|
89
|
-
|
|
90
|
-
All notable changes to this project will be documented in this file.
|
|
91
|
-
|
|
92
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
93
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
94
|
-
|
|
95
|
-
### Documentation
|
|
96
|
-
|
|
97
|
-
- 📘 Launched new documentation site: [eslint.interlace.tools](https://eslint.interlace.tools/)
|
|
98
|
-
|
|
99
|
-
## [2.0.0] - 2025-12-30
|
|
100
|
-
|
|
101
|
-
### Changed
|
|
102
|
-
|
|
103
|
-
- **Architecture Overhaul**: Complete rewrite for performance and maintainability.
|
|
104
|
-
- **Rule Parity**: Achieved 100% feature parity with `eslint-plugin-import` (46 rules).
|
|
105
|
-
- **Performance**: `no-cycle` rule is now up to 100x faster using incremental graph analysis.
|
|
106
|
-
- **TypeScript Support**: First-class support for TypeScript (parsers and resolvers) out of the box.
|
|
107
|
-
|
|
108
|
-
### Added
|
|
109
|
-
|
|
110
|
-
- **New Rules**:
|
|
111
|
-
- `prefer-node-protocol` - Enforce `node:` protocol for Node.js built-ins.
|
|
112
|
-
- `no-named-as-default` - specialized check for named exports used as default.
|
|
113
|
-
- `no-named-as-default-member` - Check for properties on default export that match named exports.
|
|
114
|
-
- `no-relative-packages` - Enforce package boundaries.
|
|
115
|
-
- `no-import-module-exports` - Disallow `module.exports` alongside imports.
|
|
116
|
-
- `no-empty-named-blocks` - Disallow empty named import blocks.
|
|
117
|
-
- `consistent-type-specifier-style` - Enforce type-only import style (inline vs top-level).
|
|
118
|
-
- `no-dynamic-require` - Disallow dynamic require calls.
|
|
119
|
-
- `no-self-import` - Detect self-referential imports.
|
|
120
|
-
- `no-named-default` - Disallow named default exports.
|
|
121
|
-
- `no-restricted-paths` - Enhanced path restriction rule.
|
|
122
|
-
- `unambiguous` - Enforce unambiguous module type.
|
|
123
|
-
- **Enhanced Documentation**: All rules now feature AEO-compliant documentation with OWASP mappings.
|
|
124
|
-
- **Improved Testing**: Comprehensive test suite covering all rules, including edge cases and TypeScript integration.
|
|
125
|
-
|
|
126
|
-
## [1.0.0] - 2024-12-05
|
|
127
|
-
|
|
128
|
-
### Added
|
|
129
|
-
|
|
130
|
-
- Initial release with 30 LLM-optimized dependency rules
|
|
131
|
-
- **Module Resolution Rules** (7 rules):
|
|
132
|
-
- `no-unresolved` - Ensure imports resolve to a module
|
|
133
|
-
- `named` - Ensure named imports exist
|
|
134
|
-
- `default` - Ensure default export exists
|
|
135
|
-
- `namespace` - Ensure namespace imports are valid
|
|
136
|
-
- `extensions` - Enforce file extension usage
|
|
137
|
-
- `no-self-import` - Prevent module from importing itself
|
|
138
|
-
- `no-duplicates` - Prevent duplicate imports
|
|
139
|
-
- **Module System Rules** (3 rules):
|
|
140
|
-
- `no-amd` - Disallow AMD imports
|
|
141
|
-
- `no-commonjs` - Disallow CommonJS imports
|
|
142
|
-
- `no-nodejs-modules` - Disallow Node.js built-in modules
|
|
143
|
-
- **Dependency Boundaries Rules** (6 rules):
|
|
144
|
-
- `no-cycle` - Detect circular dependency chains
|
|
145
|
-
- `no-internal-modules` - Forbid deep/internal module imports
|
|
146
|
-
- `no-cross-domain-imports` - Enforce domain boundaries
|
|
147
|
-
- `enforce-dependency-direction` - Enforce layered architecture
|
|
148
|
-
- `no-restricted-paths` - Restrict imports between paths
|
|
149
|
-
- `no-relative-parent-imports` - Disallow `../` imports
|
|
150
|
-
- **Export Style Rules** (6 rules):
|
|
151
|
-
- `no-default-export` - Disallow default exports
|
|
152
|
-
- `no-named-export` - Disallow named exports
|
|
153
|
-
- `prefer-default-export` - Prefer default for single exports
|
|
154
|
-
- `no-anonymous-default-export` - Disallow anonymous default exports
|
|
155
|
-
- `no-mutable-exports` - Disallow mutable exports
|
|
156
|
-
- `no-deprecated` - Disallow deprecated exports
|
|
157
|
-
- **Import Style Rules** (4 rules):
|
|
158
|
-
- `enforce-import-order` - Enforce import ordering
|
|
159
|
-
- `first` - Ensure imports are at the top
|
|
160
|
-
- `newline-after-import` - Require newline after imports
|
|
161
|
-
- `no-unassigned-import` - Disallow side-effect imports
|
|
162
|
-
- **Dependency Management Rules** (4 rules):
|
|
163
|
-
- `no-extraneous-dependencies` - Disallow unlisted dependencies
|
|
164
|
-
- `no-unused-modules` - Detect unused exports/modules
|
|
165
|
-
- `max-dependencies` - Limit number of dependencies
|
|
166
|
-
- `prefer-node-protocol` - Prefer `node:` protocol for builtins
|
|
167
|
-
- Preset configurations: `recommended`, `strict`, `module-resolution`, `import-style`, `esm`, `architecture`
|
|
168
|
-
- Full ESLint 9 flat config support
|
|
169
|
-
- ESLint MCP integration for AI assistants
|
|
170
|
-
- TypeScript type exports for all rule options
|
package/src/files/foo.d.ts
DELETED
|
@@ -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 {};
|
package/src/rules/default.d.ts
DELETED
|
@@ -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 {};
|
package/src/rules/export.d.ts
DELETED
|
@@ -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 {};
|
package/src/rules/first.d.ts
DELETED
|
@@ -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 {};
|
package/src/rules/named.d.ts
DELETED
|
@@ -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
|
-
};
|
package/src/rules/namespace.d.ts
DELETED
|
@@ -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 {};
|
package/src/rules/no-amd.d.ts
DELETED
|
@@ -1,21 +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-amd
|
|
8
|
-
* Prevents AMD require/define calls (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
export interface Options {
|
|
12
|
-
/** Allow AMD in certain contexts (e.g., legacy code) */
|
|
13
|
-
allow?: string[];
|
|
14
|
-
/** Suggest ES6 imports instead */
|
|
15
|
-
suggestES6?: boolean;
|
|
16
|
-
}
|
|
17
|
-
type RuleOptions = [Options?];
|
|
18
|
-
export declare const noAmd: TSESLint.RuleModule<"preferES6", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
export {};
|