@nx/eslint-plugin 18.0.0-beta.2 → 18.0.0-beta.3

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": "18.0.0-beta.2",
3
+ "version": "18.0.0-beta.3",
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": "18.0.0-beta.2",
37
- "@nx/js": "18.0.0-beta.2",
36
+ "@nx/devkit": "18.0.0-beta.3",
37
+ "@nx/js": "18.0.0-beta.3",
38
38
  "@typescript-eslint/type-utils": "^6.13.2",
39
39
  "@typescript-eslint/utils": "^6.13.2",
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": "18.0.0-beta.2"
45
+ "@nrwl/eslint-plugin-nx": "18.0.0-beta.3"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
@@ -8,6 +8,7 @@ export type Options = [
8
8
  ignoredDependencies?: string[];
9
9
  ignoredFiles?: string[];
10
10
  includeTransitiveDependencies?: boolean;
11
+ useLocalPathsForWorkspaceDependencies?: boolean;
11
12
  }
12
13
  ];
13
14
  export type MessageIds = 'missingDependency' | 'obsoleteDependency' | 'versionMismatch' | 'missingDependencySection';
@@ -30,6 +30,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
30
30
  checkObsoleteDependencies: { type: 'boolean' },
31
31
  checkVersionMismatches: { type: 'boolean' },
32
32
  includeTransitiveDependencies: { type: 'boolean' },
33
+ useLocalPathsForWorkspaceDependencies: { type: 'boolean' },
33
34
  },
34
35
  additionalProperties: false,
35
36
  },
@@ -50,9 +51,10 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
50
51
  ignoredDependencies: [],
51
52
  ignoredFiles: [],
52
53
  includeTransitiveDependencies: false,
54
+ useLocalPathsForWorkspaceDependencies: false,
53
55
  },
54
56
  ],
55
- create(context, [{ buildTargets, ignoredDependencies, ignoredFiles, checkMissingDependencies, checkObsoleteDependencies, checkVersionMismatches, includeTransitiveDependencies, },]) {
57
+ create(context, [{ buildTargets, ignoredDependencies, ignoredFiles, checkMissingDependencies, checkObsoleteDependencies, checkVersionMismatches, includeTransitiveDependencies, useLocalPathsForWorkspaceDependencies, },]) {
56
58
  if (!context.parserServices.isJSON) {
57
59
  return {};
58
60
  }
@@ -81,6 +83,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
81
83
  {
82
84
  includeTransitiveDependencies,
83
85
  ignoredFiles,
86
+ useLocalPathsForWorkspaceDependencies,
84
87
  });
85
88
  const expectedDependencyNames = Object.keys(npmDependencies);
86
89
  const projPackageJsonPath = (0, path_1.join)(devkit_1.workspaceRoot, sourceProject.data.root, 'package.json');
@@ -123,7 +126,9 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
123
126
  if (!checkVersionMismatches) {
124
127
  return;
125
128
  }
126
- if (npmDependencies[packageName] === '*' ||
129
+ if (npmDependencies[packageName].startsWith('file:') ||
130
+ packageRange.startsWith('file:') ||
131
+ npmDependencies[packageName] === '*' ||
127
132
  packageRange === '*' ||
128
133
  (0, semver_1.satisfies)(npmDependencies[packageName], packageRange, {
129
134
  includePrerelease: true,
@@ -14,15 +14,18 @@ function getAllDependencies(packageJson) {
14
14
  }
15
15
  exports.getAllDependencies = getAllDependencies;
16
16
  function getProductionDependencies(packageJsonPath) {
17
- if (!globalThis.projPackageJsonDeps || !(0, runtime_lint_utils_1.isTerminalRun)()) {
17
+ if (!globalThis.projPackageJsonDeps ||
18
+ !globalThis.projPackageJsonDeps[packageJsonPath] ||
19
+ !(0, runtime_lint_utils_1.isTerminalRun)()) {
18
20
  const packageJson = getPackageJson(packageJsonPath);
19
- globalThis.projPackageJsonDeps = {
21
+ globalThis.projPackageJsonDeps = globalThis.projPackageJsonDeps || {};
22
+ globalThis.projPackageJsonDeps[packageJsonPath] = {
20
23
  ...packageJson.dependencies,
21
24
  ...packageJson.peerDependencies,
22
25
  ...packageJson.optionalDependencies,
23
26
  };
24
27
  }
25
- return globalThis.projPackageJsonDeps;
28
+ return globalThis.projPackageJsonDeps[packageJsonPath];
26
29
  }
27
30
  exports.getProductionDependencies = getProductionDependencies;
28
31
  function getPackageJson(path) {