eslint-plugin-fast-import 2.2.1 → 2.2.2

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 (102) hide show
  1. package/.claude/settings.local.json +4 -4
  2. package/CHANGELOG.md +4 -0
  3. package/README.md +3 -0
  4. package/dist/module/computePackageInfo.d.ts +2 -0
  5. package/dist/module/computePackageInfo.js +4 -0
  6. package/dist/module/computePackageInfo.js.map +1 -0
  7. package/dist/module/computeRepoInfo.d.ts +5 -0
  8. package/dist/module/computeRepoInfo.js +100 -0
  9. package/dist/module/computeRepoInfo.js.map +1 -0
  10. package/dist/plugin.d.ts +1 -1
  11. package/dist/plugin.js +3 -0
  12. package/dist/plugin.js.map +1 -1
  13. package/dist/rules/alias/alias.d.ts +1 -1
  14. package/dist/rules/no-cycle/cycle.d.ts +4 -0
  15. package/dist/rules/no-cycle/cycle.js +140 -0
  16. package/dist/rules/no-cycle/cycle.js.map +1 -0
  17. package/dist/rules/no-cycle/rule.d.ts +4 -0
  18. package/dist/rules/no-cycle/rule.js +319 -0
  19. package/dist/rules/no-cycle/rule.js.map +1 -0
  20. package/dist/rules/no-empty-entry-points/rule.d.ts +3 -0
  21. package/dist/rules/no-empty-entry-points/rule.js +57 -0
  22. package/dist/rules/no-empty-entry-points/rule.js.map +1 -0
  23. package/dist/rules/no-entry-point-imports/entryPoint.d.ts +3 -0
  24. package/dist/rules/no-entry-point-imports/entryPoint.js +57 -0
  25. package/dist/rules/no-entry-point-imports/entryPoint.js.map +1 -0
  26. package/dist/rules/no-entry-point-imports/rule.d.ts +3 -0
  27. package/dist/rules/no-entry-point-imports/rule.js +60 -0
  28. package/dist/rules/no-entry-point-imports/rule.js.map +1 -0
  29. package/dist/rules/no-external-barrel-reexports/externalBarrelReexports.d.ts +3 -0
  30. package/dist/rules/no-external-barrel-reexports/externalBarrelReexports.js +42 -0
  31. package/dist/rules/no-external-barrel-reexports/externalBarrelReexports.js.map +1 -0
  32. package/dist/rules/no-external-barrel-reexports/rule.d.ts +3 -0
  33. package/dist/rules/no-external-barrel-reexports/rule.js +42 -0
  34. package/dist/rules/no-external-barrel-reexports/rule.js.map +1 -0
  35. package/dist/rules/no-named-as-default/namedAsDefault.d.ts +3 -0
  36. package/dist/rules/no-named-as-default/namedAsDefault.js +77 -0
  37. package/dist/rules/no-named-as-default/namedAsDefault.js.map +1 -0
  38. package/dist/rules/no-named-as-default/rule.d.ts +3 -0
  39. package/dist/rules/no-named-as-default/rule.js +79 -0
  40. package/dist/rules/no-named-as-default/rule.js.map +1 -0
  41. package/dist/rules/no-node-builtins/nodeBuiltins.d.ts +3 -0
  42. package/dist/rules/no-node-builtins/nodeBuiltins.js +48 -0
  43. package/dist/rules/no-node-builtins/nodeBuiltins.js.map +1 -0
  44. package/dist/rules/no-node-builtins/rule.d.ts +3 -0
  45. package/dist/rules/no-node-builtins/rule.js +49 -0
  46. package/dist/rules/no-node-builtins/rule.js.map +1 -0
  47. package/dist/rules/no-restricted-imports/restricted.d.ts +31 -0
  48. package/dist/rules/no-restricted-imports/restricted.js +196 -0
  49. package/dist/rules/no-restricted-imports/restricted.js.map +1 -0
  50. package/dist/rules/no-restricted-imports/rule.d.ts +31 -0
  51. package/dist/rules/no-restricted-imports/rule.js +204 -0
  52. package/dist/rules/no-restricted-imports/rule.js.map +1 -0
  53. package/dist/rules/no-test-imports-in-prod/rule.d.ts +3 -0
  54. package/dist/rules/no-test-imports-in-prod/rule.js +57 -0
  55. package/dist/rules/no-test-imports-in-prod/rule.js.map +1 -0
  56. package/dist/rules/no-test-imports-in-prod/testInProd.d.ts +3 -0
  57. package/dist/rules/no-test-imports-in-prod/testInProd.js +49 -0
  58. package/dist/rules/no-test-imports-in-prod/testInProd.js.map +1 -0
  59. package/dist/rules/no-test-only-imports/rule.d.ts +3 -0
  60. package/dist/rules/no-test-only-imports/rule.js +69 -0
  61. package/dist/rules/no-test-only-imports/rule.js.map +1 -0
  62. package/dist/rules/no-unnamed-entry-point-exports/rule.d.ts +3 -0
  63. package/dist/rules/no-unnamed-entry-point-exports/rule.js +41 -0
  64. package/dist/rules/no-unnamed-entry-point-exports/rule.js.map +1 -0
  65. package/dist/rules/no-unresolved-imports/rule.d.ts +3 -0
  66. package/dist/rules/no-unresolved-imports/rule.js +139 -0
  67. package/dist/rules/no-unresolved-imports/rule.js.map +1 -0
  68. package/dist/rules/no-unresolved-imports/unresolved.d.ts +3 -0
  69. package/dist/rules/no-unresolved-imports/unresolved.js +135 -0
  70. package/dist/rules/no-unresolved-imports/unresolved.js.map +1 -0
  71. package/dist/rules/no-unused-exports/rule.d.ts +3 -0
  72. package/dist/rules/no-unused-exports/rule.js +60 -0
  73. package/dist/rules/no-unused-exports/rule.js.map +1 -0
  74. package/dist/rules/no-unused-package-exports/rule.d.ts +3 -0
  75. package/dist/rules/no-unused-package-exports/rule.js +57 -0
  76. package/dist/rules/no-unused-package-exports/rule.js.map +1 -0
  77. package/dist/rules/prefer-alias-imports/alias.d.ts +6 -0
  78. package/dist/rules/prefer-alias-imports/alias.js +210 -0
  79. package/dist/rules/prefer-alias-imports/alias.js.map +1 -0
  80. package/dist/rules/prefer-alias-imports/rule.d.ts +6 -0
  81. package/dist/rules/prefer-alias-imports/rule.js +214 -0
  82. package/dist/rules/prefer-alias-imports/rule.js.map +1 -0
  83. package/dist/rules/require-node-prefix/nodePrefix.d.ts +3 -0
  84. package/dist/rules/require-node-prefix/nodePrefix.js +59 -0
  85. package/dist/rules/require-node-prefix/nodePrefix.js.map +1 -0
  86. package/dist/rules/require-node-prefix/rule.d.ts +3 -0
  87. package/dist/rules/require-node-prefix/rule.js +60 -0
  88. package/dist/rules/require-node-prefix/rule.js.map +1 -0
  89. package/dist/settings/framework.d.ts +3 -0
  90. package/dist/settings/framework.js +91 -0
  91. package/dist/settings/framework.js.map +1 -0
  92. package/dist/settings/package.d.ts +6 -0
  93. package/dist/settings/package.js +64 -0
  94. package/dist/settings/package.js.map +1 -0
  95. package/dist/settings/repo.d.ts +1 -0
  96. package/dist/settings/repo.js +6 -0
  97. package/dist/settings/repo.js.map +1 -0
  98. package/dist/settings/user.d.ts +1 -1
  99. package/dist/util/getSubpathEntry.d.ts +4 -0
  100. package/dist/util/getSubpathEntry.js +22 -0
  101. package/dist/util/getSubpathEntry.js.map +1 -0
  102. package/package.json +6 -8
@@ -0,0 +1,135 @@
1
+ import { InternalError } from '../../util/error.js';
2
+ import { createRule, getESMInfo, getLocFromRange } from '../util.js';
3
+ export const noUnresolvedImports = createRule({
4
+ name: 'no-unresolved-imports',
5
+ meta: {
6
+ docs: {
7
+ description: 'Ensures that imports point to valid exports',
8
+ },
9
+ schema: [],
10
+ fixable: undefined,
11
+ type: 'problem',
12
+ messages: {
13
+ noUnresolvedImports: 'Import "{{name}}" does not point to a valid first party export',
14
+ noTransientDependencies: 'Third party module specifier "{{specifier}}" is not listed in package.json.',
15
+ },
16
+ },
17
+ defaultOptions: [],
18
+ create(context) {
19
+ const esmInfo = getESMInfo(context);
20
+ // No project info means this file wasn't found as part of the project, e.g.
21
+ // because it's ignored
22
+ /* istanbul ignore if */
23
+ if (!esmInfo) {
24
+ return {};
25
+ }
26
+ const { fileInfo, projectInfo } = esmInfo;
27
+ /* istanbul ignore if */
28
+ if (fileInfo.fileType !== 'code') {
29
+ return {};
30
+ }
31
+ // First check imports
32
+ outer: for (const importEntry of [
33
+ ...fileInfo.singleImports,
34
+ ...fileInfo.barrelImports,
35
+ ...fileInfo.dynamicImports,
36
+ ]) {
37
+ // First, check if this is a third party dependency, and ensure that the dependency is listed
38
+ // in a package.json
39
+ if (importEntry.resolvedModuleType === 'thirdParty') {
40
+ for (const [path, deps] of projectInfo.availableThirdPartyDependencies) {
41
+ if (context.filename.startsWith(path) &&
42
+ deps.some((dep) =>
43
+ // Check if this is exactly the import specifier, e.g. 'react'
44
+ importEntry.moduleSpecifier === dep ||
45
+ // Check if this is a type import for a dep from DefinitelyTyped
46
+ // just in case someone is only using type imports w/o the
47
+ // implementation package installed
48
+ ('isTypeImport' in importEntry &&
49
+ importEntry.isTypeImport &&
50
+ `@types/${importEntry.moduleSpecifier}` === dep) ||
51
+ // Check if this is reaching into the package, e.g. 'react/path'
52
+ importEntry.moduleSpecifier?.startsWith(dep + '/'))) {
53
+ continue outer;
54
+ }
55
+ }
56
+ // Quick sanity check to see if there was a bug
57
+ /* istanbul ignore if */
58
+ if (importEntry.moduleSpecifier?.startsWith('.')) {
59
+ throw new InternalError(`Module specifier ${importEntry.moduleSpecifier} was misclassified as a third party import`);
60
+ }
61
+ // If we got here, we couldn't find a match in package.json, so error
62
+ context.report({
63
+ messageId: 'noTransientDependencies',
64
+ loc: getLocFromRange(context, importEntry.statementNodeRange),
65
+ data: {
66
+ specifier: importEntry.moduleSpecifier,
67
+ },
68
+ });
69
+ continue;
70
+ }
71
+ // Barrel/dynamic imports don't resolve to a single export, and can be
72
+ // spread across multiple files even. The specific items being imported
73
+ // isn't specified either in non-first party code, meaning the only way to
74
+ // know if an import is valid is to introspect how it's used at runtime.
75
+ // This isn't tractable, so we only validate that the module specifier
76
+ // could be resolved. If the module couldn't be resolved, we mark the file
77
+ // type as first party other, so we first have to check for that.
78
+ if (importEntry.resolvedModuleType === 'firstPartyOther' &&
79
+ importEntry.type === 'barrelImport') {
80
+ context.report({
81
+ loc: getLocFromRange(context, importEntry.reportNodeRange),
82
+ messageId: 'noUnresolvedImports',
83
+ data: {
84
+ name: importEntry.importAlias,
85
+ },
86
+ });
87
+ }
88
+ // Next, we check if the root export could be resolved, which is only
89
+ // available for single imports
90
+ if (importEntry.resolvedModuleType === 'firstPartyCode' &&
91
+ importEntry.type === 'singleImport' &&
92
+ importEntry.rootModuleType === undefined) {
93
+ context.report({
94
+ loc: getLocFromRange(context, importEntry.reportNodeRange),
95
+ messageId: 'noUnresolvedImports',
96
+ data: {
97
+ name: importEntry.importName,
98
+ },
99
+ });
100
+ }
101
+ }
102
+ // Now check reexports
103
+ for (const reexportEntry of [...fileInfo.singleReexports, ...fileInfo.barrelReexports]) {
104
+ // First check if we couldn't resolve the module specifier. If the module
105
+ // couldn't be resolved, we mark the file type as first party other, so
106
+ // we first have to check for that.
107
+ if (reexportEntry.resolvedModuleType === 'firstPartyOther' &&
108
+ reexportEntry.type === 'barrelReexport') {
109
+ context.report({
110
+ loc: getLocFromRange(context, reexportEntry.reportNodeRange),
111
+ messageId: 'noUnresolvedImports',
112
+ data: {
113
+ name: reexportEntry.exportName,
114
+ },
115
+ });
116
+ }
117
+ // Next, we check if the root export could be resolved, which is only
118
+ // available for single reexports if they are entry points
119
+ if (reexportEntry.resolvedModuleType === 'firstPartyCode' &&
120
+ reexportEntry.type === 'singleReexport' &&
121
+ reexportEntry.rootModuleType === undefined &&
122
+ (reexportEntry.isEntryPoint || reexportEntry.isExternallyImported)) {
123
+ context.report({
124
+ loc: getLocFromRange(context, reexportEntry.reportNodeRange),
125
+ messageId: 'noUnresolvedImports',
126
+ data: {
127
+ name: reexportEntry.exportName,
128
+ },
129
+ });
130
+ }
131
+ }
132
+ return {};
133
+ },
134
+ });
135
+ //# sourceMappingURL=unresolved.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unresolved.js","sourceRoot":"","sources":["../../../src/rules/no-unresolved-imports/unresolved.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,6CAA6C;SAC3D;QACD,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACR,mBAAmB,EAAE,gEAAgE;YACrF,uBAAuB,EACrB,6EAA6E;SAChF;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MA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a,IAAI,CAAC,GAAG,QAAQ,CAAC,eAAe,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACvF,yEAAyE;YACzE,uEAAuE;YACvE,mCAAmC;YACnC,IACE,aAAa,CAAC,kBAAkB,KAAK,iBAAiB;gBACtD,aAAa,CAAC,IAAI,KAAK,gBAAgB,EACvC,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC;oBACb,GAAG,EAAE,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC;oBAC5D,SAAS,EAAE,qBAAqB;oBAChC,IAAI,EAAE;wBACJ,IAAI,EAAE,aAAa,CAAC,UAAU;qBAC/B;iBACF,CAAC,CAAC;YACL,CAAC;YAED,qEAAqE;YACrE,0DAA0D;YAC1D,IACE,aAAa,CAAC,kBAAkB,KAAK,gBAAgB;gBACrD,aAAa,CAAC,IAAI,KAAK,gBAAgB;gBACvC,aAAa,CAAC,cAAc,KAAK,SAAS;gBAC1C,CAAC,aAAa,CAAC,YAAY,IAAI,aAAa,CAAC,oBAAoB,CAAC,EAClE,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC;oBACb,GAAG,EAAE,eAAe,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC;oBAC5D,SAAS,EAAE,qBAAqB;oBAChC,IAAI,EAAE;wBACJ,IAAI,EAAE,aAAa,CAAC,UAAU;qBAC/B;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const noUnusedExports: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUnusedExports", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
2
+ name: string;
3
+ };
@@ -0,0 +1,60 @@
1
+ import { createRule, getESMInfo, getLocFromRange } from '../util.js';
2
+ export const noUnusedExports = createRule({
3
+ name: 'no-unused-exports',
4
+ meta: {
5
+ docs: {
6
+ description: 'Ensure exports are imported elsewhere in the package',
7
+ },
8
+ schema: [],
9
+ fixable: undefined,
10
+ type: 'problem',
11
+ messages: {
12
+ noUnusedExports: 'Export "{{name}}" must be imported in another file',
13
+ },
14
+ },
15
+ defaultOptions: [],
16
+ create(context) {
17
+ // .d.ts files are not typically referenced directly, and instead are used
18
+ // to type ambient modules. Sometimes they are used directly though when
19
+ // paired with a neighboring vanilla JS file. Either way, we're making the
20
+ // tradeoff of potentially missing an unused type export for better DX.
21
+ if (context.filename.endsWith('.d.ts')) {
22
+ return {};
23
+ }
24
+ const esmInfo = getESMInfo(context);
25
+ // No package info means this file wasn't found as part of the package, e.g.
26
+ // because it's ignored
27
+ /* istanbul ignore if */
28
+ if (!esmInfo) {
29
+ return {};
30
+ }
31
+ const { fileInfo } = esmInfo;
32
+ /* istanbul ignore if */
33
+ if (fileInfo.fileType !== 'code') {
34
+ return {};
35
+ }
36
+ // Check each export and reexport to make sure it's being used
37
+ for (const exportEntry of [
38
+ ...fileInfo.exports,
39
+ ...fileInfo.singleReexports,
40
+ ...fileInfo.barrelReexports,
41
+ ]) {
42
+ // If this is an entry point, then it's being imported externally
43
+ if (exportEntry.isEntryPoint || exportEntry.isExternallyImported) {
44
+ continue;
45
+ }
46
+ // If imported by is empty, then this isn't used anywhere
47
+ if (exportEntry.importedBy.length === 0) {
48
+ context.report({
49
+ messageId: 'noUnusedExports',
50
+ loc: getLocFromRange(context, exportEntry.reportNodeRange),
51
+ data: {
52
+ name: exportEntry.exportName || '<unnamed>',
53
+ },
54
+ });
55
+ }
56
+ }
57
+ return {};
58
+ },
59
+ });
60
+ //# sourceMappingURL=rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../src/rules/no-unused-exports/rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,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,CAAC;oBAC1D,IAAI,EAAE;wBACJ,IAAI,EAAE,WAAW,CAAC,UAAU,IAAI,WAAW;qBAC5C;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const noUnusedPackageExports: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUnusedPackageExports", readonly unknown[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
2
+ name: string;
3
+ };
@@ -0,0 +1,57 @@
1
+ import { createRule, getESMInfo, getLocFromRange } from '../util.js';
2
+ export const noUnusedPackageExports = createRule({
3
+ name: 'no-unused-package-exports',
4
+ meta: {
5
+ docs: {
6
+ description: 'Ensure entry point exports are imported elsewhere in the monorepo',
7
+ },
8
+ schema: [],
9
+ fixable: undefined,
10
+ type: 'problem',
11
+ messages: {
12
+ noUnusedPackageExports: 'Export point export "{{name}}" must be imported in another package',
13
+ },
14
+ },
15
+ create(context) {
16
+ const esmInfo = getESMInfo(context);
17
+ // No package info means this file wasn't found as part of the package, e.g.
18
+ // because it's ignored
19
+ /* istanbul ignore if */
20
+ if (!esmInfo) {
21
+ return {};
22
+ }
23
+ const { fileInfo } = esmInfo;
24
+ /* istanbul ignore if */
25
+ if (fileInfo.fileType !== 'code') {
26
+ return {};
27
+ }
28
+ // If this file doesn't have any entry points, then we can bail early and
29
+ // avoid needing to do a more expensive filter.
30
+ if (!fileInfo.entryPointSpecifier) {
31
+ return {};
32
+ }
33
+ // Check each export and reexport to make sure it's being used
34
+ for (const exportEntry of [
35
+ ...fileInfo.exports,
36
+ ...fileInfo.barrelReexports,
37
+ ...fileInfo.singleReexports,
38
+ ]) {
39
+ // Barrel reexports that don't have a name aren't really resolvable (and
40
+ // are disallowed by lint rule anyways), so they're ignored here
41
+ if (!exportEntry.exportName) {
42
+ continue;
43
+ }
44
+ if (exportEntry.externallyImportedBy.length === 0) {
45
+ context.report({
46
+ messageId: 'noUnusedPackageExports',
47
+ loc: getLocFromRange(context, exportEntry.reportNodeRange),
48
+ data: {
49
+ name: exportEntry.exportName,
50
+ },
51
+ });
52
+ }
53
+ }
54
+ return {};
55
+ },
56
+ });
57
+ //# sourceMappingURL=rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../../src/rules/no-unused-package-exports/rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EACT,mEAAmE;SACtE;QACD,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACR,sBAAsB,EACpB,oEAAoE;SACvE;KACF;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAEpC,4EAA4E;QAC5E,uBAAuB;QACvB,wBAAwB;QACxB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC7B,wBAAwB;QACxB,IAAI,QAAQ,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACjC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,yEAAyE;QACzE,+CAA+C;QAC/C,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC;YAClC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,8DAA8D;QAC9D,KAAK,MAAM,WAAW,IAAI;YACxB,GAAG,QAAQ,CAAC,OAAO;YACnB,GAAG,QAAQ,CAAC,eAAe;YAC3B,GAAG,QAAQ,CAAC,eAAe;SAC5B,EAAE,CAAC;YACF,wEAAwE;YACxE,gEAAgE;YAChE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;gBAC5B,SAAS;YACX,CAAC;YACD,IAAI,WAAW,CAAC,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClD,OAAO,CAAC,MAAM,CAAC;oBACb,SAAS,EAAE,wBAAwB;oBACnC,GAAG,EAAE,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,eAAe,CAAC;oBAC1D,IAAI,EAAE;wBACJ,IAAI,EAAE,WAAW,CAAC,UAAU;qBAC7B;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const preferAliasImports: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferAlias" | "preferRelative", [{
2
+ mode?: "always" | "relative-if-local" | undefined;
3
+ minSharedPathDepth?: number | undefined;
4
+ } | undefined], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
5
+ name: string;
6
+ };
@@ -0,0 +1,210 @@
1
+ import { dirname, relative, resolve } from 'node:path';
2
+ import { z } from 'zod';
3
+ import { InternalError } from '../../util/error.js';
4
+ import { createRule, getESMInfo, getLocFromRange } from '../util.js';
5
+ const MODE_DEFAULT = 'relative-if-local';
6
+ const MIN_SHARED_PATH_DEPTH_DEFAULT = 1;
7
+ const schema = z
8
+ .strictObject({
9
+ mode: z.enum(['always', 'relative-if-local']).optional(),
10
+ minSharedPathDepth: z.number().int().min(0).optional(),
11
+ })
12
+ .optional();
13
+ /**
14
+ * Find the best matching wildcard alias for an absolute path.
15
+ * Returns the entry with the longest (most specific) path match.
16
+ */
17
+ function findBestWildcardAlias(absolutePath, wildcardAliases) {
18
+ let best;
19
+ for (const [symbol, path] of Object.entries(wildcardAliases)) {
20
+ if (absolutePath.startsWith(path) && (!best || path.length > best.path.length)) {
21
+ best = { symbol, path };
22
+ }
23
+ }
24
+ return best;
25
+ }
26
+ function getAliasInternalPathSegments(absolutePath, aliasPath) {
27
+ if (!absolutePath.startsWith(aliasPath)) {
28
+ return;
29
+ }
30
+ return absolutePath
31
+ .slice(aliasPath.length)
32
+ .split(/[/\\]+/)
33
+ .filter(Boolean);
34
+ }
35
+ function getSharedPathDepth(sourcePath, targetPath, aliasPath) {
36
+ const sourceSegments = getAliasInternalPathSegments(sourcePath, aliasPath);
37
+ const targetSegments = getAliasInternalPathSegments(targetPath, aliasPath);
38
+ if (!sourceSegments || !targetSegments) {
39
+ return;
40
+ }
41
+ let sharedPathDepth = 0;
42
+ while (sharedPathDepth < sourceSegments.length &&
43
+ sharedPathDepth < targetSegments.length &&
44
+ sourceSegments[sharedPathDepth] === targetSegments[sharedPathDepth]) {
45
+ sharedPathDepth++;
46
+ }
47
+ return sharedPathDepth;
48
+ }
49
+ export const preferAliasImports = createRule({
50
+ name: 'prefer-alias-imports',
51
+ meta: {
52
+ docs: {
53
+ description: 'Enforces the use of alias imports instead of relative paths when an alias is available, and vice versa for sufficiently local files under the same alias',
54
+ },
55
+ schema: [schema.toJSONSchema()],
56
+ fixable: 'code',
57
+ type: 'suggestion',
58
+ messages: {
59
+ preferAlias: 'Use alias import "{{alias}}" instead of relative path "{{relative}}"',
60
+ preferRelative: 'Use relative import "{{relative}}" instead of alias "{{alias}}" for local files under the same alias',
61
+ },
62
+ },
63
+ defaultOptions: [{ mode: MODE_DEFAULT }],
64
+ create(context) {
65
+ const esmInfo = getESMInfo(context);
66
+ /* istanbul ignore if */
67
+ if (!esmInfo) {
68
+ return {};
69
+ }
70
+ const { fileInfo, packageSettings } = esmInfo;
71
+ /* istanbul ignore if */
72
+ if (fileInfo.fileType !== 'code') {
73
+ return {};
74
+ }
75
+ const { wildcardAliases, fixedAliases } = packageSettings;
76
+ // No aliases configured — nothing to enforce
77
+ if (Object.keys(wildcardAliases).length === 0 && Object.keys(fixedAliases).length === 0) {
78
+ return {};
79
+ }
80
+ const { mode = MODE_DEFAULT, minSharedPathDepth = MIN_SHARED_PATH_DEPTH_DEFAULT } = context.options[0] ?? {};
81
+ // Pre-compute the current file's "home alias" for relative-if-local mode
82
+ const homeAlias = findBestWildcardAlias(context.filename, wildcardAliases);
83
+ for (const importEntry of [
84
+ ...fileInfo.singleImports,
85
+ ...fileInfo.barrelImports,
86
+ ...fileInfo.dynamicImports,
87
+ ...fileInfo.singleReexports,
88
+ ...fileInfo.barrelReexports,
89
+ ]) {
90
+ const { moduleSpecifier, resolvedModuleType, statementNodeRange } = importEntry;
91
+ if (!moduleSpecifier ||
92
+ (resolvedModuleType !== 'firstPartyCode' && resolvedModuleType !== 'firstPartyOther')) {
93
+ continue;
94
+ }
95
+ if (moduleSpecifier.startsWith('.')) {
96
+ // --- Relative import: check if it should use an alias ---
97
+ // Check fixed aliases first (exact resolvedModulePath match)
98
+ const { resolvedModulePath } = importEntry;
99
+ let matchedAliasName;
100
+ let matchedAliasSymbol;
101
+ let matchedAliasPath;
102
+ if (resolvedModulePath) {
103
+ for (const [alias, path] of Object.entries(fixedAliases)) {
104
+ if (resolvedModulePath === path) {
105
+ matchedAliasName = alias;
106
+ break;
107
+ }
108
+ }
109
+ }
110
+ // Check wildcard aliases
111
+ if (!matchedAliasName && resolvedModulePath) {
112
+ const match = findBestWildcardAlias(resolvedModulePath, wildcardAliases);
113
+ if (match) {
114
+ matchedAliasSymbol = match.symbol;
115
+ matchedAliasPath = match.path;
116
+ }
117
+ }
118
+ if (!matchedAliasName && !matchedAliasSymbol) {
119
+ continue;
120
+ }
121
+ const sharedPathDepth = homeAlias &&
122
+ resolvedModulePath &&
123
+ matchedAliasSymbol === homeAlias.symbol &&
124
+ matchedAliasPath === homeAlias.path
125
+ ? getSharedPathDepth(context.filename, resolvedModulePath, homeAlias.path)
126
+ : undefined;
127
+ // In relative-if-local mode, skip if the files are local enough
128
+ if (mode === 'relative-if-local') {
129
+ if (matchedAliasName) {
130
+ // Fixed alias — always different from a wildcard home alias, so report
131
+ }
132
+ else if (homeAlias &&
133
+ matchedAliasSymbol === homeAlias.symbol &&
134
+ matchedAliasPath === homeAlias.path &&
135
+ sharedPathDepth !== undefined &&
136
+ sharedPathDepth >= minSharedPathDepth) {
137
+ continue;
138
+ }
139
+ }
140
+ let newSpecifier;
141
+ if (matchedAliasName) {
142
+ newSpecifier = matchedAliasName;
143
+ }
144
+ else if (matchedAliasSymbol && matchedAliasPath) {
145
+ newSpecifier =
146
+ matchedAliasSymbol +
147
+ resolve(dirname(context.filename), moduleSpecifier).slice(matchedAliasPath.length);
148
+ }
149
+ else {
150
+ continue;
151
+ }
152
+ context.report({
153
+ messageId: 'preferAlias',
154
+ loc: getLocFromRange(context, importEntry.reportNodeRange),
155
+ data: { alias: newSpecifier, relative: moduleSpecifier },
156
+ fix(fixer) {
157
+ const sourceNode = context.sourceCode.getNodeByRangeIndex(statementNodeRange[0]);
158
+ /* istanbul ignore if */
159
+ if (!('raw' in sourceNode.source)) {
160
+ throw new InternalError(`Property "raw" is missing in sourceNode.source`);
161
+ }
162
+ return fixer.replaceText(sourceNode.source, sourceNode.source.raw.replace(moduleSpecifier, newSpecifier));
163
+ },
164
+ });
165
+ }
166
+ else if (mode === 'relative-if-local') {
167
+ // --- Alias import: check if it should be relative ---
168
+ if (moduleSpecifier in fixedAliases) {
169
+ continue;
170
+ }
171
+ if (!importEntry.resolvedModulePath) {
172
+ continue;
173
+ }
174
+ const matchedAlias = findBestWildcardAlias(importEntry.resolvedModulePath, wildcardAliases);
175
+ const sharedPathDepth = homeAlias && matchedAlias && matchedAlias.path === homeAlias.path
176
+ ? getSharedPathDepth(context.filename, importEntry.resolvedModulePath, homeAlias.path)
177
+ : undefined;
178
+ if (matchedAlias &&
179
+ homeAlias &&
180
+ matchedAlias.symbol === homeAlias.symbol &&
181
+ matchedAlias.path === homeAlias.path &&
182
+ sharedPathDepth !== undefined &&
183
+ sharedPathDepth >= minSharedPathDepth) {
184
+ let newSpecifier = relative(dirname(context.filename), resolve(matchedAlias.path, moduleSpecifier.slice(matchedAlias.symbol.length)));
185
+ if (!newSpecifier.startsWith('.')) {
186
+ newSpecifier = './' + newSpecifier;
187
+ }
188
+ context.report({
189
+ messageId: 'preferRelative',
190
+ loc: getLocFromRange(context, importEntry.reportNodeRange),
191
+ data: { relative: newSpecifier, alias: moduleSpecifier },
192
+ fix(fixer) {
193
+ const sourceNode = context.sourceCode.getNodeByRangeIndex(statementNodeRange[0]);
194
+ /* istanbul ignore if */
195
+ if (!('raw' in sourceNode.source)) {
196
+ throw new InternalError(`Property "raw" is missing in sourceNode.source`);
197
+ }
198
+ return fixer.replaceText(sourceNode.source, sourceNode.source.raw.replace(moduleSpecifier, newSpecifier));
199
+ },
200
+ });
201
+ }
202
+ // Fixed aliases that match the home alias scope could also be flagged,
203
+ // but fixed aliases are exact-match by nature — they don't have a
204
+ // "scope" in the same way. We leave them alone.
205
+ }
206
+ }
207
+ return {};
208
+ },
209
+ });
210
+ //# sourceMappingURL=alias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.js","sourceRoot":"","sources":["../../../src/rules/prefer-alias-imports/alias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOrE,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,MAAM,MAAM,GAAG,CAAC;KACb,YAAY,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,G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kB,EACrC,CAAC;oBACD,IAAI,YAAY,GAAG,QAAQ,CACzB,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EACzB,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAC9E,CAAC;oBACF,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;wBAClC,YAAY,GAAG,IAAI,GAAG,YAAY,CAAC;oBACrC,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACb,SAAS,EAAE,gBAAgB;wBAC3B,GAAG,EAAE,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,eAAe,CAAC;wBAC1D,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE;wBACxD,GAAG,CAAC,KAAK;4BACP,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAExD,CAAC;4BACxB,wBAAwB;4BACxB,IAAI,CAAC,CAAC,KAAK,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gCAClC,MAAM,IAAI,aAAa,CAAC,gDAAgD,CAAC,CAAC;4BAC5E,CAAC;4BACD,OAAO,KAAK,CAAC,WAAW,CACtB,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,CAC7D,CAAC;wBACJ,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC;gBAED,uEAAuE;gBACvE,kEAAkE;gBAClE,gDAAgD;YAClD,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const preferAliasImports: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferAlias" | "preferRelative", [{
2
+ mode?: "always" | "relative-if-local" | undefined;
3
+ minSharedPathDepth?: number | undefined;
4
+ } | undefined], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
5
+ name: string;
6
+ };