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
|
@@ -1,24 +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-anonymous-default-export
|
|
8
|
-
* Forbid anonymous values as default exports (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'anonymousDefaultExport' | 'suggestNamedExport' | 'arrowFunctionExport' | 'useNamedExport';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow anonymous arrow functions */
|
|
14
|
-
allowArrowFunction?: boolean;
|
|
15
|
-
/** Allow anonymous class expressions */
|
|
16
|
-
allowClassExpression?: boolean;
|
|
17
|
-
/** Allow anonymous function expressions */
|
|
18
|
-
allowFunctionExpression?: boolean;
|
|
19
|
-
}
|
|
20
|
-
type RuleOptions = [Options?];
|
|
21
|
-
export declare const noAnonymousDefaultExport: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
22
|
-
name: string;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,55 +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-barrel-file
|
|
8
|
-
* Detects and flags barrel files that harm build performance and tree-shaking
|
|
9
|
-
*
|
|
10
|
-
* Why This Matters:
|
|
11
|
-
* - Atlassian reduced Jira build times by 75% by removing barrel files
|
|
12
|
-
* - Barrel files prevent effective tree-shaking, bloating bundles by 50-85%
|
|
13
|
-
* - Test runners load entire module graphs, slowing test suites significantly
|
|
14
|
-
*
|
|
15
|
-
* @see https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/
|
|
16
|
-
* @see https://vercel.com/blog/how-we-optimized-package-imports-in-next-js
|
|
17
|
-
*/
|
|
18
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
19
|
-
type MessageIds = 'barrelFileDetected' | 'considerDirectExports';
|
|
20
|
-
/**
|
|
21
|
-
* Configuration options for no-barrel-file rule
|
|
22
|
-
*/
|
|
23
|
-
export interface NoBarrelFileOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Minimum number of re-exports to consider a file a barrel.
|
|
26
|
-
* Default: 3
|
|
27
|
-
*/
|
|
28
|
-
threshold?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Regex patterns for paths where barrel files are allowed.
|
|
31
|
-
* Useful for public API entry points.
|
|
32
|
-
*/
|
|
33
|
-
allowedPaths?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* Regex patterns for file paths considered barrel candidates.
|
|
36
|
-
* Default: index files
|
|
37
|
-
*/
|
|
38
|
-
barrelPatterns?: string[];
|
|
39
|
-
/**
|
|
40
|
-
* Allow barrel files that also export local declarations.
|
|
41
|
-
* Default: false
|
|
42
|
-
*/
|
|
43
|
-
allowWithLocalExports?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Maximum allowed ratio of re-exports to total exports.
|
|
46
|
-
* Files exceeding this ratio are flagged.
|
|
47
|
-
* Default: 0.8 (80%)
|
|
48
|
-
*/
|
|
49
|
-
reexportRatio?: number;
|
|
50
|
-
}
|
|
51
|
-
type RuleOptions = [NoBarrelFileOptions?];
|
|
52
|
-
export declare const noBarrelFile: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
53
|
-
name: string;
|
|
54
|
-
};
|
|
55
|
-
export {};
|
|
@@ -1,48 +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-barrel-import
|
|
8
|
-
* Flags imports from barrel files (index.ts that re-export multiple modules)
|
|
9
|
-
*
|
|
10
|
-
* IMPORTANT: This rule works in two modes:
|
|
11
|
-
* 1. Explicit mode: Configure `knownBarrels` to flag specific paths
|
|
12
|
-
* 2. Heuristic mode: Flags imports ending with /index
|
|
13
|
-
*
|
|
14
|
-
* Why This Matters:
|
|
15
|
-
* - Importing from barrels forces bundlers to load ALL re-exported modules
|
|
16
|
-
* - Direct imports enable optimal tree-shaking and faster builds
|
|
17
|
-
* - Atlassian achieved 75% build time reduction by eliminating barrel imports
|
|
18
|
-
*
|
|
19
|
-
* @see https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/
|
|
20
|
-
* @see https://vercel.com/blog/how-we-optimized-package-imports-in-next-js
|
|
21
|
-
*/
|
|
22
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
23
|
-
/**
|
|
24
|
-
* Configuration options for no-barrel-import rule
|
|
25
|
-
*/
|
|
26
|
-
export interface NoBarrelImportOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Regex patterns for import paths that are known barrels.
|
|
29
|
-
* Required to flag imports without explicit /index suffix.
|
|
30
|
-
* Example: ['^@/components$', '^@/utils$']
|
|
31
|
-
*/
|
|
32
|
-
knownBarrels?: string[];
|
|
33
|
-
/**
|
|
34
|
-
* Ignore imports from node_modules.
|
|
35
|
-
* Default: true
|
|
36
|
-
*/
|
|
37
|
-
ignoreNodeModules?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Packages to ignore (typically those with good tree-shaking).
|
|
40
|
-
* Example: ['@mui/material', 'date-fns']
|
|
41
|
-
*/
|
|
42
|
-
ignoredPackages?: string[];
|
|
43
|
-
}
|
|
44
|
-
type RuleOptions = [NoBarrelImportOptions?];
|
|
45
|
-
export declare const noBarrelImport: TSESLint.RuleModule<"barrelImportDetected", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
46
|
-
name: string;
|
|
47
|
-
};
|
|
48
|
-
export {};
|
|
@@ -1,28 +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-commonjs
|
|
8
|
-
* Prevents CommonJS require/module.exports (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'commonjsRequire' | 'commonjsExport' | 'commonjsModule' | 'preferES6';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow CommonJS in certain contexts */
|
|
14
|
-
allowRequire?: boolean;
|
|
15
|
-
/** Allow module.exports */
|
|
16
|
-
allowModuleExports?: boolean;
|
|
17
|
-
/** Allow exports.* */
|
|
18
|
-
allowExports?: boolean;
|
|
19
|
-
/** Allow CommonJS in specific files */
|
|
20
|
-
allowInFiles?: string[];
|
|
21
|
-
/** Suggest ES6 alternatives */
|
|
22
|
-
suggestES6?: boolean;
|
|
23
|
-
}
|
|
24
|
-
type RuleOptions = [Options?];
|
|
25
|
-
export declare const noCommonjs: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -1,41 +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-cross-domain-imports
|
|
8
|
-
* Prevents imports across domain/feature boundaries
|
|
9
|
-
* Priority 2: Architectural Patterns
|
|
10
|
-
*
|
|
11
|
-
* @see https://martinfowler.com/bliki/BoundedContext.html
|
|
12
|
-
*/
|
|
13
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
14
|
-
type MessageIds = 'crossDomainImport' | 'useSharedModule' | 'useEvents' | 'useApplicationService';
|
|
15
|
-
export interface Options {
|
|
16
|
-
/** Domain/feature directory patterns. Default: ['domains', 'features', 'modules'] */
|
|
17
|
-
domainPatterns?: string[];
|
|
18
|
-
/** Shared modules that can be imported. Default: ['shared', 'common', 'utils'] */
|
|
19
|
-
allowedSharedModules?: string[];
|
|
20
|
-
/** Ignore imports from node_modules. Default: true */
|
|
21
|
-
ignoreNodeModules?: boolean;
|
|
22
|
-
/** Custom domain boundary rules. Default: [] */
|
|
23
|
-
customRules?: Array<{
|
|
24
|
-
from: string;
|
|
25
|
-
to: string[];
|
|
26
|
-
allowed?: string[];
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
type RuleOptions = [Options?];
|
|
30
|
-
/**
|
|
31
|
-
* Check if import violates domain boundaries
|
|
32
|
-
*/
|
|
33
|
-
export declare function violatesDomainBoundary(sourceFile: string, importPath: string, options: Options): {
|
|
34
|
-
violates: boolean;
|
|
35
|
-
sourceDomain: string | null;
|
|
36
|
-
targetDomain: string | null;
|
|
37
|
-
};
|
|
38
|
-
export declare const noCrossDomainImports: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
export {};
|
package/src/rules/no-cycle.d.ts
DELETED
|
@@ -1,102 +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 = 'moduleSplit' | 'directImport' | 'extractShared' | 'dependencyInjection';
|
|
8
|
-
/**
|
|
9
|
-
* Clear the circular dependency cache
|
|
10
|
-
*
|
|
11
|
-
* Call this when you want to reset the cache, e.g.:
|
|
12
|
-
* - In watch mode when files change
|
|
13
|
-
* - Between test runs
|
|
14
|
-
* - When programmatically re-linting
|
|
15
|
-
*
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare function clearCircularDependencyCache(): void;
|
|
19
|
-
type FixStrategy = 'module-split' | 'direct-import' | 'extract-shared' | 'dependency-injection' | 'auto';
|
|
20
|
-
type ModuleNamingConvention = 'semantic' | 'numbered';
|
|
21
|
-
/**
|
|
22
|
-
* Incremental analysis options for large codebases
|
|
23
|
-
* Enables caching and selective analysis for better performance
|
|
24
|
-
*/
|
|
25
|
-
export interface IncrementalOptions {
|
|
26
|
-
/**
|
|
27
|
-
* Enable incremental mode - only analyze files changed since last run
|
|
28
|
-
* Uses file content hash or mtime for change detection
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
enabled?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Path to cache file for storing analysis results between runs
|
|
34
|
-
* Relative to workspace root or absolute path
|
|
35
|
-
* @default '.eslint-circular-deps-cache.json'
|
|
36
|
-
*/
|
|
37
|
-
cacheFile?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Strategy for detecting file changes
|
|
40
|
-
* - 'mtime': Use file modification time (faster but less accurate)
|
|
41
|
-
* - 'content-hash': Use content hash (slower but more accurate)
|
|
42
|
-
* @default 'content-hash'
|
|
43
|
-
*/
|
|
44
|
-
invalidateOn?: 'mtime' | 'content-hash';
|
|
45
|
-
/**
|
|
46
|
-
* Maximum age of cache entries in milliseconds before forced refresh
|
|
47
|
-
* Set to 0 for no expiration
|
|
48
|
-
* @default 86400000 (24 hours)
|
|
49
|
-
*/
|
|
50
|
-
maxCacheAge?: number;
|
|
51
|
-
}
|
|
52
|
-
export interface Options {
|
|
53
|
-
/** Maximum allowed import depth. Default: Infinity (unlimited) */
|
|
54
|
-
maxDepth?: number;
|
|
55
|
-
/** Patterns to ignore when checking for cycles (glob patterns) */
|
|
56
|
-
ignorePatterns?: string[];
|
|
57
|
-
/** Barrel exports to consider as public APIs */
|
|
58
|
-
barrelExports?: string[];
|
|
59
|
-
/** Report all cycles found or just the first one. Default: false */
|
|
60
|
-
reportAllCycles?: boolean;
|
|
61
|
-
/** Strategy for fixing cycles: 'module-split', 'direct-import', 'extract-shared', 'dependency-injection', or 'auto' */
|
|
62
|
-
fixStrategy?: FixStrategy;
|
|
63
|
-
/** Naming convention for split modules: 'semantic' or 'numbered'. Default: 'semantic' */
|
|
64
|
-
moduleNamingConvention?: ModuleNamingConvention;
|
|
65
|
-
/** Custom suffix for core module in split strategy. Default: '.core' */
|
|
66
|
-
coreModuleSuffix?: string;
|
|
67
|
-
/** Custom suffix for extended module in split strategy. Default: '.extended' */
|
|
68
|
-
extendedModuleSuffix?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Incremental analysis options for improved performance on large codebases
|
|
71
|
-
* When enabled, caches analysis results and only re-analyzes changed files
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```javascript
|
|
75
|
-
* {
|
|
76
|
-
* incremental: {
|
|
77
|
-
* enabled: true,
|
|
78
|
-
* cacheFile: '.cache/circular-deps.json',
|
|
79
|
-
* invalidateOn: 'content-hash',
|
|
80
|
-
* maxCacheAge: 86400000, // 24 hours
|
|
81
|
-
* }
|
|
82
|
-
* }
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
incremental?: IncrementalOptions;
|
|
86
|
-
/**
|
|
87
|
-
* Maximum number of files to analyze per lint run
|
|
88
|
-
* Useful for limiting analysis scope in very large monorepos
|
|
89
|
-
* Set to 0 for no limit
|
|
90
|
-
* @default 0
|
|
91
|
-
*/
|
|
92
|
-
maxFiles?: number;
|
|
93
|
-
/**
|
|
94
|
-
* Working directory for resolving paths (auto-detected if not provided)
|
|
95
|
-
*/
|
|
96
|
-
workspaceRoot?: string;
|
|
97
|
-
}
|
|
98
|
-
export type RuleOptions = [Options?];
|
|
99
|
-
export declare const noCycle: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
100
|
-
name: string;
|
|
101
|
-
};
|
|
102
|
-
export {};
|
|
@@ -1,24 +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-default-export
|
|
8
|
-
* Prevents default exports (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'defaultExport' | 'preferNamedExport' | 'defaultExportRefactor';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow default exports in specific files */
|
|
14
|
-
allowInFiles?: string[];
|
|
15
|
-
/** Allow default exports for specific patterns */
|
|
16
|
-
allowPatterns?: string[];
|
|
17
|
-
/** Suggest named export alternative */
|
|
18
|
-
suggestNamed?: boolean;
|
|
19
|
-
}
|
|
20
|
-
type RuleOptions = [Options?];
|
|
21
|
-
export declare const noDefaultExport: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
22
|
-
name: string;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -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: no-deprecated
|
|
8
|
-
* Forbid imported names marked with @deprecated documentation tag (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'deprecatedImport' | 'deprecatedExport' | 'deprecatedUsage';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow importing deprecated items (for migration periods) */
|
|
14
|
-
allow?: string[];
|
|
15
|
-
/** Custom deprecation markers to look for */
|
|
16
|
-
deprecationMarkers?: string[];
|
|
17
|
-
/** Check for deprecation in JSDoc comments */
|
|
18
|
-
checkJSDoc?: boolean;
|
|
19
|
-
/** Check for deprecation in TypeScript deprecated decorator */
|
|
20
|
-
checkDecorators?: boolean;
|
|
21
|
-
}
|
|
22
|
-
type RuleOptions = [Options?];
|
|
23
|
-
export declare const noDeprecated: 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 type { TSESLint } from '@interlace/eslint-devkit';
|
|
7
|
-
export interface Options {
|
|
8
|
-
additionalModules?: string[];
|
|
9
|
-
}
|
|
10
|
-
export type RuleOptions = [Options?];
|
|
11
|
-
export declare const noDuplicates: TSESLint.RuleModule<"noDuplicates", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
@@ -1,22 +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-dynamic-require
|
|
8
|
-
* Forbid require() calls with expressions
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
type MessageIds = 'dynamicRequire' | 'dynamicImport';
|
|
14
|
-
export interface Options {
|
|
15
|
-
/** Check dynamic imports (import()). Default: false */
|
|
16
|
-
esmodule?: boolean;
|
|
17
|
-
}
|
|
18
|
-
type RuleOptions = [Options?];
|
|
19
|
-
export declare const noDynamicRequire: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
-
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: no-empty-named-blocks
|
|
8
|
-
* Forbid empty named import blocks
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
type MessageIds = 'emptyNamedBlock' | 'suggestRemove';
|
|
14
|
-
export declare const noEmptyNamedBlocks: TSESLint.RuleModule<MessageIds, [], unknown, TSESLint.RuleListener> & {
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
@@ -1,45 +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-extraneous-dependencies
|
|
8
|
-
* Forbid the use of extraneous packages (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'extraneousDependency' | 'missingDependency' | 'devDependencyInProduction' | 'addToDependencies' | 'addToDevDependencies' | 'moveToDependencies';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow dev dependencies */
|
|
14
|
-
devDependencies?: boolean;
|
|
15
|
-
/** Allow optional dependencies */
|
|
16
|
-
optionalDependencies?: boolean;
|
|
17
|
-
/** Allow peer dependencies */
|
|
18
|
-
peerDependencies?: boolean;
|
|
19
|
-
/** Allow bundled dependencies */
|
|
20
|
-
bundledDependencies?: boolean;
|
|
21
|
-
/** Package.json file name to use */
|
|
22
|
-
packageJsonPath?: string;
|
|
23
|
-
/** Direct package.json content for testing */
|
|
24
|
-
packageJson?: PackageJson;
|
|
25
|
-
/** Dependency resolution strategy: 'strict', 'workspace', 'monorepo' */
|
|
26
|
-
resolutionStrategy?: 'strict' | 'workspace' | 'monorepo';
|
|
27
|
-
/** Allow packages matching patterns */
|
|
28
|
-
allowPatterns?: string[];
|
|
29
|
-
/** Ignore specific packages (don't report as missing) */
|
|
30
|
-
ignore?: string[];
|
|
31
|
-
/** Custom package.json detection logic */
|
|
32
|
-
customPackageJsonDetection?: boolean;
|
|
33
|
-
}
|
|
34
|
-
type RuleOptions = [Options?];
|
|
35
|
-
interface PackageJson {
|
|
36
|
-
dependencies?: Record<string, string>;
|
|
37
|
-
devDependencies?: Record<string, string>;
|
|
38
|
-
optionalDependencies?: Record<string, string>;
|
|
39
|
-
peerDependencies?: Record<string, string>;
|
|
40
|
-
bundledDependencies?: string[];
|
|
41
|
-
}
|
|
42
|
-
export declare const noExtraneousDependencies: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
43
|
-
name: string;
|
|
44
|
-
};
|
|
45
|
-
export {};
|
|
@@ -1,42 +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-full-package-import
|
|
8
|
-
* Blocks full package imports from known large packages that should use subpath imports
|
|
9
|
-
*
|
|
10
|
-
* Why This Matters:
|
|
11
|
-
* - Full imports from large packages include ALL exports in the bundle
|
|
12
|
-
* - Subpath imports enable proper tree-shaking
|
|
13
|
-
* - Bundle size can be reduced by 50-80% with proper imports
|
|
14
|
-
*
|
|
15
|
-
* @see https://webpack.js.org/guides/tree-shaking/
|
|
16
|
-
*/
|
|
17
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
18
|
-
/**
|
|
19
|
-
* Configuration for blocked packages
|
|
20
|
-
*/
|
|
21
|
-
interface BlockedPackage {
|
|
22
|
-
/** Package name to block */
|
|
23
|
-
name: string;
|
|
24
|
-
/** Suggested import pattern */
|
|
25
|
-
suggestion: string;
|
|
26
|
-
/** Example of correct import */
|
|
27
|
-
example?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Configuration options for no-full-package-import rule
|
|
31
|
-
*/
|
|
32
|
-
export interface NoFullPackageImportOptions {
|
|
33
|
-
/**
|
|
34
|
-
* Packages to block full imports from.
|
|
35
|
-
*/
|
|
36
|
-
blockedPackages?: BlockedPackage[];
|
|
37
|
-
}
|
|
38
|
-
type RuleOptions = [NoFullPackageImportOptions?];
|
|
39
|
-
export declare const noFullPackageImport: TSESLint.RuleModule<"fullPackageImport", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
40
|
-
name: string;
|
|
41
|
-
};
|
|
42
|
-
export {};
|
|
@@ -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-import-module-exports
|
|
8
|
-
* Forbid import statements with CommonJS module.exports
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
export interface Options {
|
|
14
|
-
/** Glob patterns for files to ignore */
|
|
15
|
-
exceptions?: string[];
|
|
16
|
-
}
|
|
17
|
-
type RuleOptions = [Options?];
|
|
18
|
-
export declare const noImportModuleExports: TSESLint.RuleModule<"importModuleExports", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,28 +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-internal-modules
|
|
8
|
-
* Forbid importing the submodules of other modules (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'internalModuleImport' | 'suggestPublicApi' | 'suggestBarrelExport';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Maximum allowed depth of module imports (0 = only root, 1 = one level deep, etc.) */
|
|
14
|
-
maxDepth?: number;
|
|
15
|
-
/** Glob patterns for paths that are allowed to be deep-imported */
|
|
16
|
-
allow?: string[];
|
|
17
|
-
/** Glob patterns for paths that are explicitly forbidden */
|
|
18
|
-
forbid?: string[];
|
|
19
|
-
/** Glob patterns for paths that should be ignored by this rule */
|
|
20
|
-
ignorePaths?: string[];
|
|
21
|
-
/** Strategy for handling violations: 'error', 'warn', 'autofix', 'suggest' */
|
|
22
|
-
strategy?: 'error' | 'warn' | 'autofix' | 'suggest';
|
|
23
|
-
}
|
|
24
|
-
type RuleOptions = [Options?];
|
|
25
|
-
export declare const noInternalModules: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
26
|
-
name: string;
|
|
27
|
-
};
|
|
28
|
-
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: no-legacy-imports
|
|
8
|
-
* Detects imports from deprecated internal paths and suggests alternatives
|
|
9
|
-
*
|
|
10
|
-
* Why This Matters:
|
|
11
|
-
* - Large codebases accumulate technical debt via legacy import paths
|
|
12
|
-
* - Developers unaware of new APIs continue using deprecated patterns
|
|
13
|
-
* - Migration efforts stall without automated enforcement
|
|
14
|
-
* - Helps track deprecation progress with actionable error counts
|
|
15
|
-
*
|
|
16
|
-
* @see https://semver.org/spec/v2.0.0.html#spec-item-8
|
|
17
|
-
*/
|
|
18
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
19
|
-
/**
|
|
20
|
-
* Legacy import mapping
|
|
21
|
-
*/
|
|
22
|
-
interface LegacyMapping {
|
|
23
|
-
/** Deprecated import pattern (regex or string) */
|
|
24
|
-
deprecated: string;
|
|
25
|
-
/** Suggested replacement import */
|
|
26
|
-
replacement: string;
|
|
27
|
-
/** Reason for deprecation */
|
|
28
|
-
reason?: string;
|
|
29
|
-
/** Deprecation date (for tracking) */
|
|
30
|
-
since?: string;
|
|
31
|
-
/** Deadline for migration (optional) */
|
|
32
|
-
deadline?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Configuration options for no-legacy-imports rule
|
|
36
|
-
*/
|
|
37
|
-
export interface NoLegacyImportsOptions {
|
|
38
|
-
/** Legacy import mappings */
|
|
39
|
-
mappings: LegacyMapping[];
|
|
40
|
-
/** Severity level for the deprecation */
|
|
41
|
-
severity?: 'warn' | 'error';
|
|
42
|
-
}
|
|
43
|
-
type RuleOptions = [NoLegacyImportsOptions];
|
|
44
|
-
export declare const noLegacyImports: TSESLint.RuleModule<"legacyImport", RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
47
|
-
export {};
|
|
@@ -1,22 +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-mutable-exports
|
|
8
|
-
* Forbid the use of mutable exports with `var` or `let` (eslint-plugin-import inspired)
|
|
9
|
-
*/
|
|
10
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
11
|
-
type MessageIds = 'mutableExport' | 'varExport' | 'letExport';
|
|
12
|
-
export interface Options {
|
|
13
|
-
/** Allow mutable exports in specific files */
|
|
14
|
-
allowInFiles?: string[];
|
|
15
|
-
/** Ignore specific export names */
|
|
16
|
-
ignoreExports?: string[];
|
|
17
|
-
}
|
|
18
|
-
type RuleOptions = [Options?];
|
|
19
|
-
export declare const noMutableExports: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
20
|
-
name: string;
|
|
21
|
-
};
|
|
22
|
-
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: no-named-as-default-member
|
|
8
|
-
* Forbid use of exported name as property of default export
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
export declare const noNamedAsDefaultMember: TSESLint.RuleModule<"namedAsDefaultMember", [], unknown, TSESLint.RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
@@ -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: no-named-as-default
|
|
8
|
-
* Forbid use of exported name as identifier of default export
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
export declare const noNamedAsDefault: TSESLint.RuleModule<"namedAsDefault", [], unknown, TSESLint.RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|
|
@@ -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: no-named-default
|
|
8
|
-
* Forbid named default exports
|
|
9
|
-
*
|
|
10
|
-
* @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
|
|
11
|
-
*/
|
|
12
|
-
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
13
|
-
export declare const noNamedDefault: TSESLint.RuleModule<"namedDefault", [], unknown, TSESLint.RuleListener> & {
|
|
14
|
-
name: string;
|
|
15
|
-
};
|