@nx/eslint 19.2.1 → 19.3.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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/eslint",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.3.0-beta.0",
|
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.
|
39
|
-
"@nx/js": "19.
|
38
|
+
"@nx/devkit": "19.3.0-beta.0",
|
39
|
+
"@nx/js": "19.3.0-beta.0",
|
40
40
|
"semver": "^7.5.3",
|
41
41
|
"tslib": "^2.3.0",
|
42
42
|
"typescript": "~5.4.2",
|
43
|
-
"@nx/linter": "19.
|
43
|
+
"@nx/linter": "19.3.0-beta.0"
|
44
44
|
},
|
45
45
|
"peerDependenciesMeta": {
|
46
46
|
"@zkochan/js-yaml": {
|
@@ -77,24 +77,15 @@ async function run(options, context) {
|
|
77
77
|
catch (err) {
|
78
78
|
if (err.message.includes('You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser')) {
|
79
79
|
const ruleName = err.message.match(/rule '([^']+)':/)?.[1];
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
eslintConfigPathForError =
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
const configPathForfile = hasFlatConfig
|
87
|
-
? (0, config_file_1.findFlatConfigFile)(projectRoot, context.root)
|
88
|
-
: (0, config_file_1.findOldConfigFile)(reportedFile ?? projectRoot, context.root);
|
89
|
-
if (configPathForfile) {
|
90
|
-
eslintConfigPathForError = `"${path_1.posix.relative(context.root, configPathForfile)}"`;
|
91
|
-
}
|
80
|
+
let eslintConfigPathForError = `for ${projectName}`;
|
81
|
+
if (context.projectsConfigurations?.projects?.[projectName]?.root) {
|
82
|
+
const { root } = context.projectsConfigurations.projects[projectName];
|
83
|
+
eslintConfigPathForError = `\`${root}/.eslintrc.json\``;
|
92
84
|
}
|
93
85
|
console.error(`
|
94
|
-
Error: You have attempted to use ${ruleName ? `the lint rule
|
95
|
-
${reportedFile ? `Occurred while linting ${reportedFile}` : ''}
|
86
|
+
Error: You have attempted to use ${ruleName ? `the lint rule ${ruleName}` : 'a lint rule'} which requires the full TypeScript type-checker to be available, but you do not have \`parserOptions.project\` configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config ${eslintConfigPath || eslintConfigPathForError}
|
96
87
|
|
97
|
-
Please see https://nx.dev/
|
88
|
+
Please see https://nx.dev/guides/eslint for full guidance on how to resolve this issue.
|
98
89
|
`);
|
99
90
|
return {
|
100
91
|
success: false,
|
package/src/plugins/plugin.js
CHANGED
@@ -15,6 +15,8 @@ const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculat
|
|
15
15
|
const DEFAULT_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'html', 'vue'];
|
16
16
|
const ESLINT_CONFIG_GLOB = (0, globs_1.combineGlobPatterns)([
|
17
17
|
...config_file_1.ESLINT_CONFIG_FILENAMES.map((f) => `**/${f}`),
|
18
|
+
config_file_1.baseEsLintConfigFile,
|
19
|
+
config_file_1.baseEsLintFlatConfigFile,
|
18
20
|
]);
|
19
21
|
function readTargetsCache(cachePath) {
|
20
22
|
return (0, node_fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|