@nx/eslint-plugin 19.6.0 → 19.7.0-beta.0

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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # Nx: Smart Monorepos · Fast CI
24
24
 
25
- Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
25
+ Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
26
26
 
27
27
  This package is an ESLint plugin for Nx.
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint-plugin",
3
- "version": "19.6.0",
3
+ "version": "19.7.0-beta.0",
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": {
@@ -34,8 +34,8 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "19.6.0",
38
- "@nx/js": "19.6.0",
37
+ "@nx/devkit": "19.7.0-beta.0",
38
+ "@nx/js": "19.7.0-beta.0",
39
39
  "@typescript-eslint/type-utils": "^7.16.0",
40
40
  "@typescript-eslint/utils": "^7.16.0",
41
41
  "chalk": "^4.1.0",
@@ -43,7 +43,7 @@
43
43
  "jsonc-eslint-parser": "^2.1.0",
44
44
  "semver": "^7.5.3",
45
45
  "tslib": "^2.3.0",
46
- "@nrwl/eslint-plugin-nx": "19.6.0"
46
+ "@nrwl/eslint-plugin-nx": "19.7.0-beta.0"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"
@@ -86,8 +86,8 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
86
86
  useLocalPathsForWorkspaceDependencies,
87
87
  });
88
88
  const expectedDependencyNames = Object.keys(npmDependencies);
89
- const projPackageJsonPath = (0, path_1.join)(devkit_1.workspaceRoot, sourceProject.data.root, 'package.json');
90
- const projPackageJsonDeps = (0, package_json_utils_1.getProductionDependencies)(projPackageJsonPath);
89
+ const packageJson = JSON.parse(context.sourceCode.getText());
90
+ const projPackageJsonDeps = (0, package_json_utils_1.getProductionDependencies)(packageJson);
91
91
  const rootPackageJsonDeps = (0, package_json_utils_1.getAllDependencies)(rootPackageJson);
92
92
  function validateMissingDependencies(node) {
93
93
  if (!checkMissingDependencies) {
@@ -1,4 +1,4 @@
1
- import { PackageJson } from 'nx/src/utils/package-json';
1
+ import type { PackageJson } from 'nx/src/utils/package-json';
2
2
  export declare function getAllDependencies(packageJson: PackageJson): Record<string, string>;
3
- export declare function getProductionDependencies(packageJsonPath: string): Record<string, string>;
3
+ export declare function getProductionDependencies(packageJson: PackageJson): Record<string, string>;
4
4
  export declare function getPackageJson(path: string): PackageJson;
@@ -5,7 +5,6 @@ exports.getProductionDependencies = getProductionDependencies;
5
5
  exports.getPackageJson = getPackageJson;
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const fs_1 = require("fs");
8
- const runtime_lint_utils_1 = require("./runtime-lint-utils");
9
8
  function getAllDependencies(packageJson) {
10
9
  return {
11
10
  ...packageJson.dependencies,
@@ -14,19 +13,12 @@ function getAllDependencies(packageJson) {
14
13
  ...packageJson.optionalDependencies,
15
14
  };
16
15
  }
17
- function getProductionDependencies(packageJsonPath) {
18
- if (!globalThis.projPackageJsonDeps ||
19
- !globalThis.projPackageJsonDeps[packageJsonPath] ||
20
- !(0, runtime_lint_utils_1.isTerminalRun)()) {
21
- const packageJson = getPackageJson(packageJsonPath);
22
- globalThis.projPackageJsonDeps = globalThis.projPackageJsonDeps || {};
23
- globalThis.projPackageJsonDeps[packageJsonPath] = {
24
- ...packageJson.dependencies,
25
- ...packageJson.peerDependencies,
26
- ...packageJson.optionalDependencies,
27
- };
28
- }
29
- return globalThis.projPackageJsonDeps[packageJsonPath];
16
+ function getProductionDependencies(packageJson) {
17
+ return {
18
+ ...packageJson.dependencies,
19
+ ...packageJson.peerDependencies,
20
+ ...packageJson.optionalDependencies,
21
+ };
30
22
  }
31
23
  function getPackageJson(path) {
32
24
  if ((0, fs_1.existsSync)(path)) {