@nx/eslint-plugin 17.2.6 → 17.2.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint-plugin",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@nx/devkit": "17.2.
|
|
37
|
-
"@nx/js": "17.2.
|
|
36
|
+
"@nx/devkit": "17.2.7",
|
|
37
|
+
"@nx/js": "17.2.7",
|
|
38
38
|
"@typescript-eslint/type-utils": "^6.9.1",
|
|
39
39
|
"@typescript-eslint/utils": "^6.9.1",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"jsonc-eslint-parser": "^2.1.0",
|
|
43
43
|
"semver": "7.5.3",
|
|
44
44
|
"tslib": "^2.3.0",
|
|
45
|
-
"@nrwl/eslint-plugin-nx": "17.2.
|
|
45
|
+
"@nrwl/eslint-plugin-nx": "17.2.7"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
@@ -225,7 +225,7 @@ exports.default = utils_2.ESLintUtils.RuleCreator(() => ``)({
|
|
|
225
225
|
if (sourceProject === targetProject) {
|
|
226
226
|
if (!allowCircularSelfDependency &&
|
|
227
227
|
!(0, fileutils_1.isRelativePath)(imp) &&
|
|
228
|
-
!(0, runtime_lint_utils_1.
|
|
228
|
+
!(0, runtime_lint_utils_1.belongsToDifferentNgEntryPoint)(imp, sourceFilePath, sourceProject.data.root)) {
|
|
229
229
|
context.report({
|
|
230
230
|
node,
|
|
231
231
|
messageId: 'noSelfCircularDependencies',
|
|
@@ -77,12 +77,9 @@ export declare function groupImports(importsToRemap: {
|
|
|
77
77
|
importPath: string;
|
|
78
78
|
}[]): string;
|
|
79
79
|
/**
|
|
80
|
-
* Checks if
|
|
81
|
-
* @param targetProjectLocator
|
|
82
|
-
* @param importExpr
|
|
83
|
-
* @returns
|
|
80
|
+
* Checks if source file belongs to a secondary entry point different than the import one
|
|
84
81
|
*/
|
|
85
|
-
export declare function
|
|
82
|
+
export declare function belongsToDifferentNgEntryPoint(importExpr: string, filePath: string, projectRoot: string): boolean;
|
|
86
83
|
/**
|
|
87
84
|
* Returns true if the given project contains MFE config with "exposes:" section
|
|
88
85
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appIsMFERemote = exports.
|
|
3
|
+
exports.appIsMFERemote = exports.belongsToDifferentNgEntryPoint = exports.groupImports = exports.isTerminalRun = exports.hasBuildExecutor = exports.isDirectDependency = exports.hasBannedDependencies = exports.findTransitiveExternalDependencies = exports.hasBannedImport = exports.getSourceFilePath = exports.onlyLoadChildren = exports.findConstraintsFor = exports.findProjectUsingImport = exports.isAbsoluteImportIntoAnotherProject = exports.findProject = exports.getTargetProjectBasedOnRelativeImport = exports.isRelative = exports.matchImportWithWildcard = exports.findDependenciesWithTags = exports.isComboDepConstraint = exports.hasNoneOfTheseTags = exports.stringifyTags = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path = tslib_1.__importStar(require("path"));
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -311,17 +311,21 @@ function groupImports(importsToRemap) {
|
|
|
311
311
|
}
|
|
312
312
|
exports.groupImports = groupImports;
|
|
313
313
|
/**
|
|
314
|
-
* Checks if
|
|
315
|
-
* @param targetProjectLocator
|
|
316
|
-
* @param importExpr
|
|
317
|
-
* @returns
|
|
314
|
+
* Checks if source file belongs to a secondary entry point different than the import one
|
|
318
315
|
*/
|
|
319
|
-
function
|
|
320
|
-
const
|
|
321
|
-
|
|
316
|
+
function belongsToDifferentNgEntryPoint(importExpr, filePath, projectRoot) {
|
|
317
|
+
const resolvedImportFile = (0, internal_1.resolveModuleByImport)(importExpr, filePath, // not strictly necessary, but speeds up resolution
|
|
318
|
+
(0, path_1.join)(devkit_1.workspaceRoot, (0, js_1.getRootTsConfigFileName)()));
|
|
319
|
+
if (!resolvedImportFile) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
const importEntryPoint = getAngularEntryPoint(resolvedImportFile, projectRoot);
|
|
323
|
+
const srcEntryPoint = getAngularEntryPoint(filePath, projectRoot);
|
|
324
|
+
// check if the entry point of import expression is different than the source file's entry point
|
|
325
|
+
return importEntryPoint !== srcEntryPoint;
|
|
322
326
|
}
|
|
323
|
-
exports.
|
|
324
|
-
function
|
|
327
|
+
exports.belongsToDifferentNgEntryPoint = belongsToDifferentNgEntryPoint;
|
|
328
|
+
function getAngularEntryPoint(file, projectRoot) {
|
|
325
329
|
let parent = (0, devkit_1.joinPathFragments)(file, '../');
|
|
326
330
|
while (parent !== `${projectRoot}/`) {
|
|
327
331
|
// we need to find closest existing ng-package.json
|
|
@@ -330,11 +334,11 @@ function fileIsSecondaryEntryPoint(file, projectRoot) {
|
|
|
330
334
|
if (ngPackageContent) {
|
|
331
335
|
// https://github.com/ng-packagr/ng-packagr/blob/23c718d04eea85e015b4c261310b7bd0c39e5311/src/ng-package.schema.json#L54
|
|
332
336
|
const entryFile = (0, devkit_1.parseJson)(ngPackageContent)?.lib?.entryFile;
|
|
333
|
-
return
|
|
337
|
+
return (0, devkit_1.joinPathFragments)(parent, entryFile);
|
|
334
338
|
}
|
|
335
339
|
parent = (0, devkit_1.joinPathFragments)(parent, '../');
|
|
336
340
|
}
|
|
337
|
-
return
|
|
341
|
+
return undefined;
|
|
338
342
|
}
|
|
339
343
|
/**
|
|
340
344
|
* Returns true if the given project contains MFE config with "exposes:" section
|