@nx/eslint 24.0.0-beta.3 → 24.0.0-beta.4

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.
@@ -4,4 +4,3 @@ export { useFlatConfig } from './src/utils/flat-config';
4
4
  export { javaScriptOverride, typeScriptOverride, } from './src/generators/init/global-eslint-config';
5
5
  export { setupRootEsLint } from './src/generators/lint-project/setup-root-eslint';
6
6
  export { getInstalledEslintVersion, typescriptESLintVersion, versions, } from './src/utils/versions';
7
- export type { Schema } from './src/executors/lint/schema';
@@ -1,3 +1,2 @@
1
- import { GeneratorCallback, ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit';
1
+ import { GeneratorCallback, ProjectConfiguration, Tree } from '@nx/devkit';
2
2
  export declare function migrateConfigToMonorepoStyle(projects: ProjectConfiguration[], tree: Tree, unitTestRunner: string, eslintConfigFormat: 'mjs' | 'cjs', keepExistingVersions?: boolean): GeneratorCallback;
3
- export declare function findLintTarget(project: ProjectConfiguration): TargetConfiguration;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateConfigToMonorepoStyle = migrateConfigToMonorepoStyle;
4
- exports.findLintTarget = findLintTarget;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const path_1 = require("path");
7
6
  const eslint_file_1 = require("../utils/eslint-file");
@@ -50,14 +49,8 @@ function migrateConfigToMonorepoStyle(projects, tree, unitTestRunner, eslintConf
50
49
  // update extends in all projects' eslint configs
51
50
  projects.forEach((project) => {
52
51
  let eslintFile;
53
- const lintTarget = findLintTarget(project);
54
- if (lintTarget) {
55
- // If target is configured in project.json, read file from target options.
56
- eslintFile =
57
- lintTarget.options?.eslintConfig || (0, eslint_file_1.findEslintFile)(tree, project.root);
58
- }
59
- else if ((0, plugin_1.hasEslintPlugin)(tree)) {
60
- // Otherwise, if `@nx/eslint/plugin` is used, match any of the known config files.
52
+ if ((0, plugin_1.hasEslintPlugin)(tree)) {
53
+ // If `@nx/eslint/plugin` is used, match any of the known config files.
61
54
  for (const f of config_file_1.ESLINT_CONFIG_FILENAMES) {
62
55
  if (tree.exists((0, devkit_1.joinPathFragments)(project.root, f))) {
63
56
  eslintFile = f;
@@ -80,10 +73,6 @@ function migrateConfigToMonorepoStyle(projects, tree, unitTestRunner, eslintConf
80
73
  '@nx/eslint-plugin': versions_1.nxVersion,
81
74
  }, undefined, keepExistingVersions ?? true);
82
75
  }
83
- function findLintTarget(project) {
84
- return Object.values(project.targets ?? {}).find((target) => target.executor === '@nx/eslint:lint' ||
85
- target.executor === '@nx/linter:eslint');
86
- }
87
76
  function migrateEslintFile(projectEslintPath, tree) {
88
77
  const baseFile = (0, eslint_file_1.findEslintFile)(tree);
89
78
  if ((0, eslint_file_1.isEslintConfigSupported)(tree)) {
@@ -252,10 +252,9 @@ function rootHasEslintLintTarget(targets) {
252
252
  return false;
253
253
  }
254
254
  for (const targetConfig of Object.values(targets)) {
255
- if (['@nx/eslint:lint', '@nx/linter:eslint'].includes(targetConfig.executor) ||
256
- (targetConfig.executor === 'nx:run-commands' &&
257
- targetConfig.options?.command &&
258
- targetConfig.options?.command.startsWith('eslint '))) {
255
+ if (targetConfig.executor === 'nx:run-commands' &&
256
+ targetConfig.options?.command &&
257
+ targetConfig.options?.command.startsWith('eslint ')) {
259
258
  return true;
260
259
  }
261
260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "24.0.0-beta.3",
3
+ "version": "24.0.0-beta.4",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -71,19 +71,19 @@
71
71
  }
72
72
  },
73
73
  "peerDependencies": {
74
- "@nx/jest": "24.0.0-beta.3",
74
+ "@nx/jest": "24.0.0-beta.4",
75
75
  "@zkochan/js-yaml": "0.0.7",
76
76
  "eslint": "^9.0.0 || ^10.0.0"
77
77
  },
78
78
  "dependencies": {
79
- "@nx/devkit": "24.0.0-beta.3",
80
- "@nx/js": "24.0.0-beta.3",
79
+ "@nx/devkit": "24.0.0-beta.4",
80
+ "@nx/js": "24.0.0-beta.4",
81
81
  "semver": "^7.6.3",
82
82
  "tslib": "^2.3.0",
83
83
  "typescript": "~6.0.3"
84
84
  },
85
85
  "devDependencies": {
86
- "nx": "24.0.0-beta.3"
86
+ "nx": "24.0.0-beta.4"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@nx/jest": {
@@ -1,32 +0,0 @@
1
- import type { JsonObject } from '@angular-devkit/core';
2
- import type { Linter } from 'eslint';
3
-
4
- export interface Schema extends JsonObject {
5
- eslintConfig: string | null;
6
- lintFilePatterns: string[];
7
- format: Formatter;
8
- force: boolean;
9
- silent: boolean;
10
- fix: boolean;
11
- cache: boolean;
12
- noEslintrc: boolean;
13
- outputFile: string | null;
14
- cacheLocation: string | null;
15
- maxWarnings: number;
16
- quiet: boolean;
17
- ignorePath: string | null;
18
-
19
- /** @deprecated No longer has any effect. Will be removed in Nx v23. */
20
- hasTypeAwareRules?: boolean;
21
- cacheStrategy: 'content' | 'metadata' | null;
22
- rulesdir: string[];
23
- resolvePluginsRelativeTo: string | null;
24
- reportUnusedDisableDirectives: Linter.StringSeverity | null;
25
- printConfig?: string | null;
26
- errorOnUnmatchedPattern?: boolean;
27
- suppressAll?: boolean;
28
- suppressRule?: string[];
29
- suppressionsLocation?: string;
30
- }
31
-
32
- type Formatter = 'stylish' | 'html' | 'json' | 'json-with-metadata';
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function getEslintTargets(tree: Tree): Set<string>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEslintTargets = getEslintTargets;
4
- const internal_1 = require("@nx/devkit/internal");
5
- function getEslintTargets(tree) {
6
- const eslintTargetNames = new Set();
7
- (0, internal_1.forEachExecutorOptions)(tree, '@nx/eslint:lint', (_, __, target) => {
8
- eslintTargetNames.add(target);
9
- });
10
- (0, internal_1.forEachExecutorOptions)(tree, '@nx/linter:eslint', (_, __, target) => {
11
- eslintTargetNames.add(target);
12
- });
13
- (0, internal_1.forEachExecutorOptions)(tree, '@nrwl/linter:eslint', (_, __, target) => {
14
- eslintTargetNames.add(target);
15
- });
16
- return eslintTargetNames;
17
- }