@nx/eslint 19.4.0-canary.20240622-963f753 → 19.4.0-canary.20240627-c2c6a13
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 +4 -4
- package/src/executors/lint/lint.impl.js +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +8 -4
- package/src/generators/init/init-migration.d.ts +2 -2
- package/src/generators/init/init-migration.js +3 -0
- package/src/generators/lint-project/lint-project.js +2 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/eslint",
|
3
|
-
"version": "19.4.0-canary.
|
3
|
+
"version": "19.4.0-canary.20240627-c2c6a13",
|
4
4
|
"private": false,
|
5
5
|
"description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
6
6
|
"repository": {
|
@@ -35,12 +35,12 @@
|
|
35
35
|
"eslint": "^8.0.0 || ^9.0.0"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@nx/devkit": "19.4.0-canary.
|
39
|
-
"@nx/js": "19.4.0-canary.
|
38
|
+
"@nx/devkit": "19.4.0-canary.20240627-c2c6a13",
|
39
|
+
"@nx/js": "19.4.0-canary.20240627-c2c6a13",
|
40
40
|
"semver": "^7.5.3",
|
41
41
|
"tslib": "^2.3.0",
|
42
42
|
"typescript": "~5.4.2",
|
43
|
-
"@nx/linter": "19.4.0-canary.
|
43
|
+
"@nx/linter": "19.4.0-canary.20240627-c2c6a13"
|
44
44
|
},
|
45
45
|
"peerDependenciesMeta": {
|
46
46
|
"@zkochan/js-yaml": {
|
@@ -31,7 +31,7 @@ async function run(options, context) {
|
|
31
31
|
// the flat config would be resolved starting from the cwd, which we changed to the workspace root
|
32
32
|
// so we explicitly set the config path to the flat config file path we previously found
|
33
33
|
if (hasFlatConfig && !normalizedOptions.eslintConfig) {
|
34
|
-
normalizedOptions.eslintConfig = path_1.
|
34
|
+
normalizedOptions.eslintConfig = (0, path_1.relative)(systemRoot, flatConfigFilePath);
|
35
35
|
}
|
36
36
|
/**
|
37
37
|
* We want users to have the option of not specifying the config path, and let
|
@@ -9,10 +9,14 @@ const utils_1 = require("nx/src/tasks-runner/utils");
|
|
9
9
|
const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
|
10
10
|
async function convertToInferred(tree, options) {
|
11
11
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
12
|
-
const
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
const migratedProjects = await (0, executor_to_plugin_migrator_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/eslint/plugin', plugin_1.createNodesV2, { targetName: 'lint' }, [
|
13
|
+
{
|
14
|
+
executors: ['@nx/eslint:lint', '@nrwl/linter:eslint'],
|
15
|
+
postTargetTransformer,
|
16
|
+
targetPluginOptionMapper: (targetName) => ({ targetName }),
|
17
|
+
},
|
18
|
+
], options.project);
|
19
|
+
if (migratedProjects.size === 0) {
|
16
20
|
throw new Error('Could not find any targets to migrate.');
|
17
21
|
}
|
18
22
|
if (!options.skipFormat) {
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit';
|
2
|
-
export declare function migrateConfigToMonorepoStyle(projects: ProjectConfiguration[], tree: Tree, unitTestRunner: string, keepExistingVersions?: boolean):
|
1
|
+
import { GeneratorCallback, ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit';
|
2
|
+
export declare function migrateConfigToMonorepoStyle(projects: ProjectConfiguration[], tree: Tree, unitTestRunner: string, keepExistingVersions?: boolean): GeneratorCallback;
|
3
3
|
export declare function findLintTarget(project: ProjectConfiguration): TargetConfiguration;
|
@@ -64,6 +64,9 @@ function migrateConfigToMonorepoStyle(projects, tree, unitTestRunner, keepExisti
|
|
64
64
|
}
|
65
65
|
}
|
66
66
|
});
|
67
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
68
|
+
'@nx/eslint-plugin': versions_1.nxVersion,
|
69
|
+
});
|
67
70
|
}
|
68
71
|
exports.migrateConfigToMonorepoStyle = migrateConfigToMonorepoStyle;
|
69
72
|
function findLintTarget(project) {
|
@@ -82,7 +82,8 @@ async function lintProjectGeneratorInternal(tree, options) {
|
|
82
82
|
filteredProjects.push(project);
|
83
83
|
}
|
84
84
|
});
|
85
|
-
(0, init_migration_1.migrateConfigToMonorepoStyle)(filteredProjects, tree, options.unitTestRunner, options.keepExistingVersions);
|
85
|
+
const migrateTask = (0, init_migration_1.migrateConfigToMonorepoStyle)(filteredProjects, tree, options.unitTestRunner, options.keepExistingVersions);
|
86
|
+
tasks.push(migrateTask);
|
86
87
|
}
|
87
88
|
}
|
88
89
|
// our root `.eslintrc` is already the project config, so we should not override it
|