@nrwl/linter 14.8.3 → 15.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -1
- package/migrations.json +6 -0
- package/package.json +5 -6
- package/src/executors/lint/schema.json +5 -3
- package/src/generators/init/init.js +1 -81
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/lint-project/lint-project.js +8 -31
- package/src/generators/lint-project/lint-project.js.map +1 -1
- package/src/generators/utils/linter.d.ts +0 -1
- package/src/generators/utils/linter.js +0 -1
- package/src/generators/utils/linter.js.map +1 -1
- package/src/migrations/update-15-0-0/add-eslint-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-eslint-inputs.js +39 -0
- package/src/migrations/update-15-0-0/add-eslint-inputs.js.map +1 -0
- package/src/utils/versions.d.ts +0 -1
- package/src/utils/versions.js +1 -2
- package/src/utils/versions.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
|
-
|
6
|
+
# [15.0.0-beta.1](https://github.com/nrwl/nx/compare/14.8.0...15.0.0-beta.1) (2022-10-05)
|
7
7
|
|
8
8
|
**Note:** Version bump only for package @nrwl/linter
|
package/migrations.json
CHANGED
@@ -88,6 +88,12 @@
|
|
88
88
|
"version": "14.4.4",
|
89
89
|
"description": "Switch from @typescript-eslint/experimental-utils to @typescript-eslint/utils in all rules and rules.spec files",
|
90
90
|
"factory": "./src/migrations/update-14-4-4/experimental-to-utils-rules"
|
91
|
+
},
|
92
|
+
"add-eslint-inputs": {
|
93
|
+
"cli": "nx",
|
94
|
+
"version": "15.0.0-beta.0",
|
95
|
+
"description": "Stop hashing eslint config files for build targets and dependent tasks",
|
96
|
+
"factory": "./src/migrations/update-15-0-0/add-eslint-inputs"
|
91
97
|
}
|
92
98
|
},
|
93
99
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nrwl/linter",
|
3
|
-
"version": "
|
3
|
+
"version": "15.0.0-beta.1",
|
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": {
|
@@ -12,7 +12,6 @@
|
|
12
12
|
"Monorepo",
|
13
13
|
"Web",
|
14
14
|
"Lint",
|
15
|
-
"TSLint",
|
16
15
|
"ESLint",
|
17
16
|
"CLI"
|
18
17
|
],
|
@@ -34,10 +33,10 @@
|
|
34
33
|
"eslint": "^8.0.0"
|
35
34
|
},
|
36
35
|
"dependencies": {
|
37
|
-
"@nrwl/devkit": "
|
38
|
-
"@nrwl/jest": "
|
36
|
+
"@nrwl/devkit": "15.0.0-beta.1",
|
37
|
+
"@nrwl/jest": "15.0.0-beta.1",
|
39
38
|
"@phenomnomnominal/tsquery": "4.1.1",
|
40
|
-
"nx": "
|
39
|
+
"nx": "15.0.0-beta.1",
|
41
40
|
"tmp": "~0.2.1",
|
42
41
|
"tslib": "^2.3.0"
|
43
42
|
},
|
@@ -50,5 +49,5 @@
|
|
50
49
|
"access": "public"
|
51
50
|
},
|
52
51
|
"types": "./index.d.ts",
|
53
|
-
"gitHead": "
|
52
|
+
"gitHead": "49c5e5069b80605943ef3bbe965e291d79354cd5"
|
54
53
|
}
|
@@ -8,14 +8,14 @@
|
|
8
8
|
"linter": {
|
9
9
|
"description": "The tool to use for running lint checks.",
|
10
10
|
"type": "string",
|
11
|
-
"enum": ["eslint"
|
11
|
+
"enum": ["eslint"],
|
12
12
|
"default": "eslint"
|
13
13
|
},
|
14
14
|
"config": {
|
15
15
|
"type": "string",
|
16
16
|
"description": "The name of the configuration file.",
|
17
17
|
"x-completion-type": "file",
|
18
|
-
"x-completion-glob": "
|
18
|
+
"x-completion-glob": ".eslintrc.json)"
|
19
19
|
},
|
20
20
|
"tsConfig": {
|
21
21
|
"description": "The name of the TypeScript configuration file.",
|
@@ -57,7 +57,9 @@
|
|
57
57
|
"tap"
|
58
58
|
]
|
59
59
|
},
|
60
|
-
{
|
60
|
+
{
|
61
|
+
"minLength": 1
|
62
|
+
}
|
61
63
|
]
|
62
64
|
},
|
63
65
|
"exclude": {
|
@@ -3,70 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lintInitGenerator = void 0;
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
5
5
|
const versions_1 = require("../../utils/versions");
|
6
|
-
const linter_1 = require("../utils/linter");
|
7
6
|
const eslint_file_1 = require("../utils/eslint-file");
|
8
|
-
const globalTsLintConfiguration = {
|
9
|
-
rulesDirectory: ['node_modules/@nrwl/workspace/src/tslint'],
|
10
|
-
linterOptions: {
|
11
|
-
exclude: ['**/*'],
|
12
|
-
},
|
13
|
-
rules: {
|
14
|
-
'arrow-return-shorthand': true,
|
15
|
-
'callable-types': true,
|
16
|
-
'class-name': true,
|
17
|
-
deprecation: {
|
18
|
-
severity: 'warn',
|
19
|
-
},
|
20
|
-
forin: true,
|
21
|
-
'import-blacklist': [true, 'rxjs/Rx'],
|
22
|
-
'interface-over-type-literal': true,
|
23
|
-
'member-access': false,
|
24
|
-
'member-ordering': [
|
25
|
-
true,
|
26
|
-
{
|
27
|
-
order: [
|
28
|
-
'static-field',
|
29
|
-
'instance-field',
|
30
|
-
'static-method',
|
31
|
-
'instance-method',
|
32
|
-
],
|
33
|
-
},
|
34
|
-
],
|
35
|
-
'no-arg': true,
|
36
|
-
'no-bitwise': true,
|
37
|
-
'no-console': [true, 'debug', 'info', 'time', 'timeEnd', 'trace'],
|
38
|
-
'no-construct': true,
|
39
|
-
'no-debugger': true,
|
40
|
-
'no-duplicate-super': true,
|
41
|
-
'no-empty': false,
|
42
|
-
'no-empty-interface': true,
|
43
|
-
'no-eval': true,
|
44
|
-
'no-inferrable-types': [true, 'ignore-params'],
|
45
|
-
'no-misused-new': true,
|
46
|
-
'no-non-null-assertion': true,
|
47
|
-
'no-shadowed-variable': true,
|
48
|
-
'no-string-literal': false,
|
49
|
-
'no-string-throw': true,
|
50
|
-
'no-switch-case-fall-through': true,
|
51
|
-
'no-unnecessary-initializer': true,
|
52
|
-
'no-unused-expression': true,
|
53
|
-
'no-var-keyword': true,
|
54
|
-
'object-literal-sort-keys': false,
|
55
|
-
'prefer-const': true,
|
56
|
-
radix: true,
|
57
|
-
'triple-equals': [true, 'allow-null-check'],
|
58
|
-
'unified-signatures': true,
|
59
|
-
'variable-name': false,
|
60
|
-
'nx-enforce-module-boundaries': [
|
61
|
-
true,
|
62
|
-
{
|
63
|
-
enforceBuildableLibDependency: true,
|
64
|
-
allow: [],
|
65
|
-
depConstraints: [{ sourceTag: '*', onlyDependOnLibsWithTags: ['*'] }],
|
66
|
-
},
|
67
|
-
],
|
68
|
-
},
|
69
|
-
};
|
70
7
|
const getGlobalEsLintConfiguration = (unitTestRunner) => {
|
71
8
|
const config = {
|
72
9
|
root: true,
|
@@ -138,18 +75,6 @@ const getGlobalEsLintConfiguration = (unitTestRunner) => {
|
|
138
75
|
}
|
139
76
|
return config;
|
140
77
|
};
|
141
|
-
function initTsLint(tree, options) {
|
142
|
-
if (tree.exists('/tslint.json')) {
|
143
|
-
return () => { };
|
144
|
-
}
|
145
|
-
(0, devkit_1.writeJson)(tree, 'tslint.json', globalTsLintConfiguration);
|
146
|
-
return !options.skipPackageJson
|
147
|
-
? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
148
|
-
tslint: versions_1.tslintVersion,
|
149
|
-
'@angular-devkit/build-angular': versions_1.buildAngularVersion,
|
150
|
-
})
|
151
|
-
: () => { };
|
152
|
-
}
|
153
78
|
function addTargetDefaults(tree) {
|
154
79
|
var _a, _b, _c, _d;
|
155
80
|
var _e, _f;
|
@@ -200,12 +125,7 @@ function initEsLint(tree, options) {
|
|
200
125
|
: () => { };
|
201
126
|
}
|
202
127
|
function lintInitGenerator(tree, options) {
|
203
|
-
|
204
|
-
return initEsLint(tree, options);
|
205
|
-
}
|
206
|
-
else if (options.linter === linter_1.Linter.TsLint) {
|
207
|
-
return initTsLint(tree, options);
|
208
|
-
}
|
128
|
+
return initEsLint(tree, options);
|
209
129
|
}
|
210
130
|
exports.lintInitGenerator = lintInitGenerator;
|
211
131
|
//# sourceMappingURL=init.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,mDAK8B;AAG9B,sDAAsD;AAStD,MAAM,4BAA4B,GAAG,CAAC,cAAuB,EAAE,EAAE;IAC/D,MAAM,MAAM,GAAsB;QAChC,IAAI,EAAE,IAAI;QACV,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB;;;;;;WAMG;QACH,SAAS,EAAE;YACT;;;eAGG;YACH;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;gBACzC,KAAK,EAAE;oBACL,oCAAoC,EAAE;wBACpC,OAAO;wBACP;4BACE,6BAA6B,EAAE,IAAI;4BACnC,KAAK,EAAE,EAAE;4BACT,cAAc,EAAE;gCACd,EAAE,SAAS,EAAE,GAAG,EAAE,wBAAwB,EAAE,CAAC,GAAG,CAAC,EAAE;6BACpD;yBACF;qBACF;iBACF;aACF;YAED;;;eAGG;YACH;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,OAAO,EAAE,CAAC,4BAA4B,CAAC;gBACvC;;;mBAGG;gBACH,KAAK,EAAE,EAAE;aACV;YAED;;;eAGG;YACH;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,OAAO,EAAE,CAAC,4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ports.lintProjectGenerator = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
6
|
-
const linter_1 = require("../utils/linter");
|
7
6
|
const eslint_file_1 = require("../utils/eslint-file");
|
8
7
|
const path_1 = require("path");
|
9
8
|
const init_1 = require("../init/init");
|
10
|
-
function createTsLintConfiguration(tree, projectConfig) {
|
11
|
-
(0, devkit_1.writeJson)(tree, (0, path_1.join)(projectConfig.root, `tslint.json`), {
|
12
|
-
extends: `${(0, devkit_1.offsetFromRoot)(projectConfig.root)}tslint.json`,
|
13
|
-
// Include project files to be linted since the global one excludes all files.
|
14
|
-
linterOptions: {
|
15
|
-
exclude: ['!**/*'],
|
16
|
-
},
|
17
|
-
rules: {},
|
18
|
-
});
|
19
|
-
}
|
20
9
|
function createEsLintConfiguration(tree, projectConfig, setParserOptionsProject) {
|
21
10
|
const eslintConfig = (0, eslint_file_1.findEslintFile)(tree);
|
22
11
|
(0, devkit_1.writeJson)(tree, (0, path_1.join)(projectConfig.root, `.eslintrc.json`), {
|
@@ -71,26 +60,14 @@ function lintProjectGenerator(tree, options) {
|
|
71
60
|
skipPackageJson: options.skipPackageJson,
|
72
61
|
});
|
73
62
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
createEsLintConfiguration(tree, projectConfig, options.setParserOptionsProject);
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
projectConfig.targets['lint'] = {
|
86
|
-
executor: '@angular-devkit/build-angular:tslint',
|
87
|
-
options: {
|
88
|
-
tsConfig: options.tsConfigPaths,
|
89
|
-
exclude: ['**/node_modules/**', `!${projectConfig.root}/**/*`],
|
90
|
-
},
|
91
|
-
};
|
92
|
-
createTsLintConfiguration(tree, projectConfig);
|
93
|
-
}
|
63
|
+
projectConfig.targets['lint'] = {
|
64
|
+
executor: '@nrwl/linter:eslint',
|
65
|
+
outputs: ['{options.outputFile}'],
|
66
|
+
options: {
|
67
|
+
lintFilePatterns: options.eslintFilePatterns,
|
68
|
+
},
|
69
|
+
};
|
70
|
+
createEsLintConfiguration(tree, projectConfig, options.setParserOptionsProject);
|
94
71
|
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
95
72
|
if (!options.skipFormat) {
|
96
73
|
yield (0, devkit_1.formatFiles)(tree);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;
|
1
|
+
{"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AAGtB,sDAAsD;AACtD,+BAA4B;AAC5B,uCAAiD;AAajD,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC,EACnC,uBAAgC;IAEhC,MAAM,YAAY,GAAG,IAAA,4BAAc,EAAC,IAAI,CAAC,CAAC;IAC1C,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE;QAC1D,OAAO,EAAE,YAAY;YACnB,CAAC,CAAC,CAAC,GAAG,IAAA,uBAAc,EAAC,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,EAAE,CAAC;YAC1D,CAAC,CAAC,SAAS;QACb,8EAA8E;QAC9E,cAAc,EAAE,CAAC,OAAO,CAAC;QACzB,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;gBACzC;;;;;;;;;;;;mBAYG;gBACH,aAAa,EAAE,CAAC,uBAAuB;oBACrC,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC;wBACE,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,IAAI,mBAAmB,CAAC;qBACpD;gBACL;;;mBAGG;gBACH,KAAK,EAAE,EAAE;aACV;YACD;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,KAAK,EAAE,EAAE;aACV;YACD;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,KAAK,EAAE,EAAE;aACV;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAsB,oBAAoB,CACxC,IAAU,EACV,OAA2B;;QAE3B,MAAM,WAAW,GAAG,IAAA,wBAAiB,EAAC,IAAI,EAAE;YAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,eAAe,EAAE,OAAO,CAAC,eAAe;SACzC,CAAC,CAAC;QACH,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtE,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG;YAC9B,QAAQ,EAAE,qBAAqB;YAC/B,OAAO,EAAE,CAAC,sBAAsB,CAAC;YACjC,OAAO,EAAE;gBACP,gBAAgB,EAAE,OAAO,CAAC,kBAAkB;aAC7C;SACF,CAAC;QACF,yBAAyB,CACvB,IAAI,EACJ,aAAa,EACb,OAAO,CAAC,uBAAuB,CAChC,CAAC;QAEF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AA/BD,oDA+BC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/linter.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/linter.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,uBAAa,CAAA;AACf,CAAC,EAHW,MAAM,GAAN,cAAM,KAAN,cAAM,QAGjB"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
5
|
+
const executor_options_utils_1 = require("@nrwl/workspace/src/utilities/executor-options-utils");
|
6
|
+
const path_1 = require("path");
|
7
|
+
function default_1(tree) {
|
8
|
+
var _a, _b, _c, _d;
|
9
|
+
var _e;
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
11
|
+
const workspaceConfiguration = (0, devkit_1.readWorkspaceConfiguration)(tree);
|
12
|
+
const globalEslintFile = ['.eslintrc.js', '.eslintrc.json'].find((file) => tree.exists(file));
|
13
|
+
if (globalEslintFile && ((_a = workspaceConfiguration.namedInputs) === null || _a === void 0 ? void 0 : _a.production)) {
|
14
|
+
const productionFileset = new Set(workspaceConfiguration.namedInputs.production);
|
15
|
+
productionFileset.add('!{projectRoot}/.eslintrc.json');
|
16
|
+
workspaceConfiguration.namedInputs.production =
|
17
|
+
Array.from(productionFileset);
|
18
|
+
}
|
19
|
+
for (const targetName of getEslintTargets(tree)) {
|
20
|
+
(_b = workspaceConfiguration.targetDefaults) !== null && _b !== void 0 ? _b : (workspaceConfiguration.targetDefaults = {});
|
21
|
+
const lintTargetDefaults = ((_c = (_e = workspaceConfiguration.targetDefaults)[targetName]) !== null && _c !== void 0 ? _c : (_e[targetName] = {}));
|
22
|
+
(_d = lintTargetDefaults.inputs) !== null && _d !== void 0 ? _d : (lintTargetDefaults.inputs = [
|
23
|
+
'default',
|
24
|
+
...(globalEslintFile ? [(0, path_1.join)('{workspaceRoot}', globalEslintFile)] : []),
|
25
|
+
]);
|
26
|
+
}
|
27
|
+
(0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfiguration);
|
28
|
+
yield (0, devkit_1.formatFiles)(tree);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
exports.default = default_1;
|
32
|
+
function getEslintTargets(tree) {
|
33
|
+
const eslintTargetNames = new Set();
|
34
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/linter:eslint', (_, __, target) => {
|
35
|
+
eslintTargetNames.add(target);
|
36
|
+
});
|
37
|
+
return eslintTargetNames;
|
38
|
+
}
|
39
|
+
//# sourceMappingURL=add-eslint-inputs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"add-eslint-inputs.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,iGAA8F;AAC9F,+BAA4B;AAE5B,mBAA+B,IAAU;;;;QACvC,MAAM,sBAAsB,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;QAEhE,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;QAEF,IAAI,gBAAgB,KAAI,MAAA,sBAAsB,CAAC,WAAW,0CAAE,UAAU,CAAA,EAAE;YACtE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAC9C,CAAC;YACF,iBAAiB,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YACvD,sBAAsB,CAAC,WAAW,CAAC,UAAU;gBAC3C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SACjC;QAED,KAAK,MAAM,UAAU,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC/C,MAAA,sBAAsB,CAAC,cAAc,oCAArC,sBAAsB,CAAC,cAAc,GAAK,EAAE,EAAC;YAC7C,MAAM,kBAAkB,GAAG,aAAC,sBAAsB,CAAC,cAAc,EAC/D,UAAU,wCAAV,UAAU,IACN,EAAE,EAAC,CAAC;YAEV,MAAA,kBAAkB,CAAC,MAAM,oCAAzB,kBAAkB,CAAC,MAAM,GAAK;gBAC5B,SAAS;gBACT,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACzE,EAAC;SACH;QAED,IAAA,qCAA4B,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;QAE3D,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AA/BD,4BA+BC;AAED,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,IAAA,+CAAsB,EAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;QACpE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
package/src/utils/versions.d.ts
CHANGED
package/src/utils/versions.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.eslintConfigPrettierVersion = exports.eslintVersion = exports.typescriptESLintVersion = exports.buildAngularVersion = exports.tslintToEslintConfigVersion = exports.
|
3
|
+
exports.eslintConfigPrettierVersion = exports.eslintVersion = exports.typescriptESLintVersion = exports.buildAngularVersion = exports.tslintToEslintConfigVersion = exports.nxVersion = void 0;
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
5
|
-
exports.tslintVersion = '~6.1.0';
|
6
5
|
exports.tslintToEslintConfigVersion = '^2.13.0';
|
7
6
|
exports.buildAngularVersion = '~14.2.0';
|
8
7
|
exports.typescriptESLintVersion = '^5.36.1';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,2BAA2B,GAAG,SAAS,CAAC;AACxC,QAAA,mBAAmB,GAAG,SAAS,CAAC;AAEhC,QAAA,uBAAuB,GAAG,SAAS,CAAC;AACpC,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,2BAA2B,GAAG,OAAO,CAAC"}
|