@nx/eslint 19.4.0-canary.20240626-3a2e8d4 → 19.4.0-canary.20240628-336d371
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": "19.4.0-canary.
|
3
|
+
"version": "19.4.0-canary.20240628-336d371",
|
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.20240628-336d371",
|
39
|
+
"@nx/js": "19.4.0-canary.20240628-336d371",
|
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.20240628-336d371"
|
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
|
@@ -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
|
package/src/plugins/plugin.js
CHANGED
@@ -12,6 +12,7 @@ const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
12
12
|
const semver_1 = require("semver");
|
13
13
|
const config_file_1 = require("../utils/config-file");
|
14
14
|
const resolve_eslint_class_1 = require("../utils/resolve-eslint-class");
|
15
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
15
16
|
const DEFAULT_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'html', 'vue'];
|
16
17
|
const PROJECT_CONFIG_FILENAMES = ['project.json', 'package.json'];
|
17
18
|
const ESLINT_CONFIG_GLOB_V1 = (0, globs_1.combineGlobPatterns)(config_file_1.ESLINT_CONFIG_FILENAMES.map((f) => `**/${f}`));
|
@@ -275,6 +276,18 @@ function buildEslintTargets(eslintConfigs, eslintVersion, projectRoot, workspace
|
|
275
276
|
{ externalDependencies: ['eslint'] },
|
276
277
|
],
|
277
278
|
outputs: ['{options.outputFile}'],
|
279
|
+
metadata: {
|
280
|
+
technologies: ['eslint'],
|
281
|
+
description: 'Runs ESLint on project',
|
282
|
+
help: {
|
283
|
+
command: `${pmc.exec} eslint --help`,
|
284
|
+
example: {
|
285
|
+
options: {
|
286
|
+
'max-warnings': 0,
|
287
|
+
},
|
288
|
+
},
|
289
|
+
},
|
290
|
+
},
|
278
291
|
};
|
279
292
|
// Always set the environment variable to ensure that the ESLint CLI can run on eslint v8 and v9
|
280
293
|
const useFlatConfig = eslintConfigs.some((config) => (0, config_file_1.isFlatConfig)(config));
|