@nx/eslint-plugin 16.10.0 → 17.0.0-beta.1
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-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@nx/devkit": "
|
|
37
|
-
"@nx/js": "
|
|
36
|
+
"@nx/devkit": "17.0.0-beta.1",
|
|
37
|
+
"@nx/js": "17.0.0-beta.1",
|
|
38
38
|
"@typescript-eslint/type-utils": "^5.60.1",
|
|
39
39
|
"@typescript-eslint/utils": "^5.60.1",
|
|
40
40
|
"chalk": "^4.1.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"jsonc-eslint-parser": "^2.1.0",
|
|
43
43
|
"semver": "7.5.3",
|
|
44
44
|
"tslib": "^2.3.0",
|
|
45
|
-
"@nrwl/eslint-plugin-nx": "
|
|
45
|
+
"@nrwl/eslint-plugin-nx": "17.0.0-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
@@ -4,13 +4,14 @@ exports.workspaceRules = void 0;
|
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const internal_1 = require("@nx/js/src/internal");
|
|
6
6
|
const constants_1 = require("./constants");
|
|
7
|
+
const path_1 = require("path");
|
|
7
8
|
exports.workspaceRules = (() => {
|
|
8
9
|
// If `tools/eslint-rules` folder doesn't exist, there is no point trying to register and load it
|
|
9
10
|
if (!(0, fs_1.existsSync)(constants_1.WORKSPACE_PLUGIN_DIR)) {
|
|
10
11
|
return {};
|
|
11
12
|
}
|
|
12
13
|
// Register `tools/eslint-rules` for TS transpilation
|
|
13
|
-
const registrationCleanup = (0, internal_1.registerTsProject)(constants_1.WORKSPACE_PLUGIN_DIR);
|
|
14
|
+
const registrationCleanup = (0, internal_1.registerTsProject)((0, path_1.join)(constants_1.WORKSPACE_PLUGIN_DIR, 'tsconfig.json'));
|
|
14
15
|
try {
|
|
15
16
|
/**
|
|
16
17
|
* Currently we only support applying the rules from the user's workspace plugin object
|
|
@@ -193,13 +193,13 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
193
193
|
.join(),
|
|
194
194
|
},
|
|
195
195
|
fix: (fixer) => {
|
|
196
|
-
const dependencies = Object.keys(projPackageJsonDeps)
|
|
197
|
-
.map((d) => `\n "${d}": "${projPackageJsonDeps[d]}"`)
|
|
198
|
-
.join(',');
|
|
199
196
|
expectedDependencyNames.sort().reduce((acc, d) => {
|
|
200
197
|
acc[d] = rootPackageJsonDeps[d] || dependencies[d];
|
|
201
198
|
return acc;
|
|
202
199
|
}, projPackageJsonDeps);
|
|
200
|
+
const dependencies = Object.keys(projPackageJsonDeps)
|
|
201
|
+
.map((d) => `\n "${d}": "${projPackageJsonDeps[d]}"`)
|
|
202
|
+
.join(',');
|
|
203
203
|
if (!node.properties.length) {
|
|
204
204
|
return fixer.replaceText(node, `{\n "dependencies": {${dependencies}\n }\n}`);
|
|
205
205
|
}
|
|
@@ -9,6 +9,7 @@ const path = require("path");
|
|
|
9
9
|
const create_eslint_rule_1 = require("../utils/create-eslint-rule");
|
|
10
10
|
const project_graph_utils_1 = require("../utils/project-graph-utils");
|
|
11
11
|
const semver_1 = require("semver");
|
|
12
|
+
const path_1 = require("path");
|
|
12
13
|
const DEFAULT_OPTIONS = {
|
|
13
14
|
generatorsJson: 'generators.json',
|
|
14
15
|
executorsJson: 'executors.json',
|
|
@@ -88,7 +89,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
88
89
|
return {};
|
|
89
90
|
}
|
|
90
91
|
if (!global.tsProjectRegistered) {
|
|
91
|
-
(0, internal_1.registerTsProject)(devkit_1.workspaceRoot, 'tsconfig.base.json');
|
|
92
|
+
(0, internal_1.registerTsProject)((0, path_1.join)(devkit_1.workspaceRoot, 'tsconfig.base.json'));
|
|
92
93
|
global.tsProjectRegistered = true;
|
|
93
94
|
}
|
|
94
95
|
return {
|