@nrwl/linter 15.3.0-beta.9 → 15.3.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -1
- package/package.json +3 -5
- package/src/generators/workspace-rules-project/workspace-rules-project.js +25 -3
- package/src/generators/workspace-rules-project/workspace-rules-project.js.map +1 -1
- package/src/migrations/update-13-3-0/eslint-8-updates.js +4 -2
- package/src/migrations/update-13-3-0/eslint-8-updates.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
# [15.3.0-
|
6
|
+
# [15.3.0-rc.0](https://github.com/nrwl/nx/compare/15.2.0...15.3.0-rc.0) (2022-12-05)
|
7
7
|
|
8
8
|
**Note:** Version bump only for package @nrwl/linter
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nrwl/linter",
|
3
|
-
"version": "15.3.0-
|
3
|
+
"version": "15.3.0-rc.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
6
6
|
"repository": {
|
@@ -33,10 +33,8 @@
|
|
33
33
|
"eslint": "^8.0.0"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@nrwl/devkit": "15.3.0-
|
37
|
-
"@nrwl/jest": "15.3.0-beta.9",
|
36
|
+
"@nrwl/devkit": "15.3.0-rc.0",
|
38
37
|
"@phenomnomnominal/tsquery": "4.1.1",
|
39
|
-
"nx": "15.3.0-beta.9",
|
40
38
|
"tmp": "~0.2.1",
|
41
39
|
"tslib": "^2.3.0"
|
42
40
|
},
|
@@ -49,5 +47,5 @@
|
|
49
47
|
"access": "public"
|
50
48
|
},
|
51
49
|
"types": "./index.d.ts",
|
52
|
-
"gitHead": "
|
50
|
+
"gitHead": "5d910c0f1a9ec3ba6d7ebd78072af5cc5caf86c5"
|
53
51
|
}
|
@@ -3,16 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lintWorkspaceRulesProjectSchematic = exports.lintWorkspaceRulesProjectGenerator = exports.WORKSPACE_PLUGIN_DIR = exports.WORKSPACE_RULES_PROJECT_NAME = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
6
|
-
const jest_1 = require("@nrwl/jest");
|
7
6
|
const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
|
8
7
|
const path_1 = require("path");
|
9
8
|
const workspace_lint_rules_1 = require("../../utils/workspace-lint-rules");
|
10
9
|
const versions_1 = require("nx/src/utils/versions");
|
10
|
+
const versions_2 = require("../../utils/versions");
|
11
11
|
exports.WORKSPACE_RULES_PROJECT_NAME = 'eslint-rules';
|
12
12
|
exports.WORKSPACE_PLUGIN_DIR = 'tools/eslint-rules';
|
13
13
|
function lintWorkspaceRulesProjectGenerator(tree) {
|
14
14
|
var _a, _b;
|
15
15
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
16
|
+
yield (0, devkit_1.ensurePackage)(tree, '@nrwl/jest/', versions_2.nxVersion);
|
17
|
+
const { addPropertyToJestConfig, jestProjectGenerator } = yield Promise.resolve().then(() => require('@nrwl/jest'));
|
16
18
|
// Noop if the workspace rules project already exists
|
17
19
|
try {
|
18
20
|
(0, devkit_1.readProjectConfiguration)(tree, exports.WORKSPACE_RULES_PROJECT_NAME);
|
@@ -41,17 +43,37 @@ function lintWorkspaceRulesProjectGenerator(tree) {
|
|
41
43
|
(0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfig);
|
42
44
|
}
|
43
45
|
// Add jest to the project and return installation task
|
44
|
-
const installTask = yield
|
46
|
+
const installTask = yield jestProjectGenerator(tree, {
|
45
47
|
project: exports.WORKSPACE_RULES_PROJECT_NAME,
|
46
48
|
supportTsx: false,
|
47
49
|
skipSerializers: true,
|
48
50
|
setupFile: 'none',
|
49
51
|
compiler: 'tsc',
|
52
|
+
skipFormat: true,
|
53
|
+
});
|
54
|
+
(0, devkit_1.updateJson)(tree, (0, path_1.join)(workspace_lint_rules_1.workspaceLintPluginDir, 'tsconfig.spec.json'), (json) => {
|
55
|
+
if (json.include) {
|
56
|
+
json.include = json.include.map((v) => {
|
57
|
+
if (v.startsWith('src/**')) {
|
58
|
+
return v.replace('src/', '');
|
59
|
+
}
|
60
|
+
return v;
|
61
|
+
});
|
62
|
+
}
|
63
|
+
if (json.exclude) {
|
64
|
+
json.exclude = json.exclude.map((v) => {
|
65
|
+
if (v.startsWith('src/**')) {
|
66
|
+
return v.replace('src/', '');
|
67
|
+
}
|
68
|
+
return v;
|
69
|
+
});
|
70
|
+
}
|
71
|
+
return json;
|
50
72
|
});
|
51
73
|
// Add swc dependencies
|
52
74
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@swc-node/register': versions_1.swcNodeVersion, '@swc/core': versions_1.swcCoreVersion });
|
53
75
|
// Add extra config to the jest.config.ts file to allow ESLint 8 exports mapping to work with jest
|
54
|
-
|
76
|
+
addPropertyToJestConfig(tree, (0, devkit_1.joinPathFragments)(exports.WORKSPACE_PLUGIN_DIR, 'jest.config.ts'), 'moduleNameMapper', {
|
55
77
|
'@eslint/eslintrc': '@eslint/eslintrc/dist/eslintrc-universal.cjs',
|
56
78
|
});
|
57
79
|
yield (0, devkit_1.formatFiles)(tree);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"workspace-rules-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts"],"names":[],"mappings":";;;;AAAA,
|
1
|
+
{"version":3,"file":"workspace-rules-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts"],"names":[],"mappings":";;;;AAAA,yCAcsB;AACtB,yEAAyF;AACzF,+BAA4B;AAC5B,2EAA0E;AAC1E,oDAA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AA8C;SACnE,CACF,CAAC;QAEF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,WAAW,CAAC;;CACpB;AA9FD,gFA8FC;AAEY,QAAA,kCAAkC,GAAG,IAAA,2BAAkB,EAClE,kCAAkC,CACnC,CAAC"}
|
@@ -2,14 +2,16 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
5
|
-
const jest_1 = require("@nrwl/jest");
|
6
5
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
6
|
+
const versions_1 = require("../../utils/versions");
|
7
7
|
function eslint8Updates(tree) {
|
8
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
9
9
|
try {
|
10
|
+
yield (0, devkit_1.ensurePackage)(tree, '@nrwl/jest/', versions_1.nxVersion);
|
11
|
+
const { addPropertyToJestConfig } = yield Promise.resolve().then(() => require('@nrwl/jest'));
|
10
12
|
const existingJestConfigPath = (0, devkit_1.normalizePath)('tools/eslint-rules/jest.config.js');
|
11
13
|
// Add extra config to the jest.config.js file to allow ESLint 8 exports mapping to work with jest
|
12
|
-
|
14
|
+
addPropertyToJestConfig(tree, existingJestConfigPath, 'moduleNameMapper', {
|
13
15
|
'@eslint/eslintrc': '@eslint/eslintrc/dist/eslintrc-universal.cjs',
|
14
16
|
});
|
15
17
|
(0, devkit_1.visitNotIgnoredFiles)(tree, 'tools/eslint-rules', (path) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eslint-8-updates.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"eslint-8-updates.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,uDAAoD;AACpD,mD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