@nx/eslint 0.0.0-pr-22870-9ecd080 → 0.0.0-pr-26623-78cbba7
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",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-26623-78cbba7",
|
|
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": "0.0.0-pr-
|
|
39
|
-
"@nx/js": "0.0.0-pr-
|
|
38
|
+
"@nx/devkit": "0.0.0-pr-26623-78cbba7",
|
|
39
|
+
"@nx/js": "0.0.0-pr-26623-78cbba7",
|
|
40
40
|
"semver": "^7.5.3",
|
|
41
41
|
"tslib": "^2.3.0",
|
|
42
42
|
"typescript": "~5.4.2",
|
|
43
|
-
"@nx/linter": "0.0.0-pr-
|
|
43
|
+
"@nx/linter": "0.0.0-pr-26623-78cbba7"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"@zkochan/js-yaml": {
|
|
@@ -6,7 +6,6 @@ const plugin_1 = require("../../plugins/plugin");
|
|
|
6
6
|
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
7
7
|
const target_options_map_1 = require("./lib/target-options-map");
|
|
8
8
|
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
9
|
-
const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
|
|
10
9
|
async function convertToInferred(tree, options) {
|
|
11
10
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
12
11
|
const migratedProjectsModern = await (0, executor_to_plugin_migrator_1.migrateExecutorToPlugin)(tree, projectGraph, '@nx/eslint:lint', '@nx/eslint/plugin', (targetName) => ({ targetName }), postTargetTransformer, plugin_1.createNodesV2, options.project);
|
|
@@ -20,7 +19,7 @@ async function convertToInferred(tree, options) {
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
exports.convertToInferred = convertToInferred;
|
|
23
|
-
function postTargetTransformer(target, tree, projectDetails
|
|
22
|
+
function postTargetTransformer(target, tree, projectDetails) {
|
|
24
23
|
if (target.inputs) {
|
|
25
24
|
const inputs = target.inputs.filter((input) => typeof input === 'string' &&
|
|
26
25
|
![
|
|
@@ -34,75 +33,48 @@ function postTargetTransformer(target, tree, projectDetails, inferredTargetConfi
|
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
if (target.options) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (target.configurations) {
|
|
40
|
-
for (const configurationName in target.configurations) {
|
|
41
|
-
const configuration = target.configurations[configurationName];
|
|
42
|
-
handlePropertiesInOptions(configuration, projectDetails, target);
|
|
36
|
+
if ('eslintConfig' in target.options) {
|
|
37
|
+
delete target.options.eslintConfig;
|
|
43
38
|
}
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
if ('force' in target.options) {
|
|
40
|
+
delete target.options.force;
|
|
41
|
+
}
|
|
42
|
+
if ('silent' in target.options) {
|
|
43
|
+
delete target.options.silent;
|
|
44
|
+
}
|
|
45
|
+
if ('hasTypeAwareRules' in target.options) {
|
|
46
|
+
delete target.options.hasTypeAwareRules;
|
|
47
|
+
}
|
|
48
|
+
if ('errorOnUnmatchedPattern' in target.options) {
|
|
49
|
+
if (!target.options.errorOnUnmatchedPattern) {
|
|
50
|
+
target.options['no-error-on-unmatched-pattern'] = true;
|
|
52
51
|
}
|
|
52
|
+
delete target.options.errorOnUnmatchedPattern;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
projectName: projectDetails.projectName,
|
|
58
|
-
projectRoot: projectDetails.root,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return target;
|
|
62
|
-
}
|
|
63
|
-
function handlePropertiesInOptions(options, projectDetails, target) {
|
|
64
|
-
if ('eslintConfig' in options) {
|
|
65
|
-
options.config = (0, plugin_migration_utils_1.toProjectRelativePath)(options.eslintConfig, projectDetails.root);
|
|
66
|
-
delete options.eslintConfig;
|
|
67
|
-
}
|
|
68
|
-
if ('force' in options) {
|
|
69
|
-
delete options.force;
|
|
70
|
-
}
|
|
71
|
-
if ('silent' in options) {
|
|
72
|
-
delete options.silent;
|
|
73
|
-
}
|
|
74
|
-
if ('hasTypeAwareRules' in options) {
|
|
75
|
-
delete options.hasTypeAwareRules;
|
|
76
|
-
}
|
|
77
|
-
if ('errorOnUnmatchedPattern' in options) {
|
|
78
|
-
if (!options.errorOnUnmatchedPattern) {
|
|
79
|
-
options['no-error-on-unmatched-pattern'] = true;
|
|
54
|
+
if ('outputFile' in target.options) {
|
|
55
|
+
target.outputs ??= [];
|
|
56
|
+
target.outputs.push(target.options.outputFile);
|
|
80
57
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
for (const key in target_options_map_1.targetOptionsToCliMap) {
|
|
88
|
-
if (options[key]) {
|
|
89
|
-
const prevValue = options[key];
|
|
90
|
-
delete options[key];
|
|
91
|
-
options[target_options_map_1.targetOptionsToCliMap[key]] = prevValue;
|
|
58
|
+
for (const key in target_options_map_1.targetOptionsToCliMap) {
|
|
59
|
+
if (target.options[key]) {
|
|
60
|
+
target.options[target_options_map_1.targetOptionsToCliMap[key]] = target.options[key];
|
|
61
|
+
delete target.options[key];
|
|
62
|
+
}
|
|
92
63
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
64
|
+
if ('lintFilePatterns' in target.options) {
|
|
65
|
+
const normalizedLintFilePatterns = target.options.lintFilePatterns.map((pattern) => {
|
|
66
|
+
return (0, utils_1.interpolate)(pattern, {
|
|
67
|
+
workspaceRoot: '',
|
|
68
|
+
projectRoot: projectDetails.root,
|
|
69
|
+
projectName: projectDetails.projectName,
|
|
70
|
+
});
|
|
100
71
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
72
|
+
target.options.args = normalizedLintFilePatterns.map((pattern) => pattern.startsWith(projectDetails.root)
|
|
73
|
+
? pattern.replace(new RegExp(`^${projectDetails.root}/`), './')
|
|
74
|
+
: pattern);
|
|
75
|
+
delete target.options.lintFilePatterns;
|
|
76
|
+
}
|
|
106
77
|
}
|
|
78
|
+
return target;
|
|
107
79
|
}
|
|
108
80
|
exports.default = convertToInferred;
|