@nrwl/linter 15.7.1 → 15.8.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/migrations.json +6 -0
- package/package.json +4 -3
- package/src/generators/init/init.js +2 -0
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/utils/eslint-targets.d.ts +2 -0
- package/src/generators/utils/eslint-targets.js +13 -0
- package/src/generators/utils/eslint-targets.js.map +1 -0
- package/src/generators/workspace-rules-project/workspace-rules-project.js +3 -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 +1 -1
- package/src/migrations/update-13-3-0/eslint-8-updates.js.map +1 -1
- package/src/migrations/update-15-0-0/add-eslint-inputs.js +2 -9
- package/src/migrations/update-15-0-0/add-eslint-inputs.js.map +1 -1
- package/src/migrations/update-15-7-1/add-eslint-ignore.d.ts +2 -0
- package/src/migrations/update-15-7-1/add-eslint-ignore.js +42 -0
- package/src/migrations/update-15-7-1/add-eslint-ignore.js.map +1 -0
package/migrations.json
CHANGED
@@ -53,6 +53,12 @@
|
|
53
53
|
"version": "15.0.0-beta.0",
|
54
54
|
"description": "Stop hashing eslint config files for build targets and dependent tasks",
|
55
55
|
"factory": "./src/migrations/update-15-0-0/add-eslint-inputs"
|
56
|
+
},
|
57
|
+
"add-eslint-ignore": {
|
58
|
+
"cli": "nx",
|
59
|
+
"version": "15.7.1-beta.0",
|
60
|
+
"description": "Add node_modules to root eslint ignore",
|
61
|
+
"factory": "./src/migrations/update-15-7-1/add-eslint-ignore"
|
56
62
|
}
|
57
63
|
},
|
58
64
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nrwl/linter",
|
3
|
-
"version": "15.
|
3
|
+
"version": "15.8.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": {
|
@@ -33,7 +33,8 @@
|
|
33
33
|
"eslint": "^8.0.0"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@nrwl/devkit": "15.
|
36
|
+
"@nrwl/devkit": "15.8.0-beta.1",
|
37
|
+
"@nrwl/js": "15.8.0-beta.1",
|
37
38
|
"@phenomnomnominal/tsquery": "4.1.1",
|
38
39
|
"tmp": "~0.2.1",
|
39
40
|
"tslib": "^2.3.0"
|
@@ -47,5 +48,5 @@
|
|
47
48
|
"access": "public"
|
48
49
|
},
|
49
50
|
"types": "./index.d.ts",
|
50
|
-
"gitHead": "
|
51
|
+
"gitHead": "347d6dd92077b793139c77a7a6bd9baf7a1f975c"
|
51
52
|
}
|
@@ -21,6 +21,7 @@ function addTargetDefaults(tree) {
|
|
21
21
|
(_d = (_f = nxJson.targetDefaults.lint).inputs) !== null && _d !== void 0 ? _d : (_f.inputs = [
|
22
22
|
'default',
|
23
23
|
`{workspaceRoot}/.eslintrc.json`,
|
24
|
+
`{workspaceRoot}/.eslintignore`,
|
24
25
|
]);
|
25
26
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
26
27
|
}
|
@@ -32,6 +33,7 @@ function initEsLint(tree, options) {
|
|
32
33
|
(0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nrwl/linter'], []);
|
33
34
|
}
|
34
35
|
(0, devkit_1.writeJson)(tree, '.eslintrc.json', (0, global_eslint_config_1.getGlobalEsLintConfiguration)(options.unitTestRunner, options.rootProject));
|
36
|
+
tree.write('.eslintignore', 'node_modules\n');
|
35
37
|
addTargetDefaults(tree);
|
36
38
|
if (tree.exists('.vscode/extensions.json')) {
|
37
39
|
(0, devkit_1.updateJson)(tree, '.vscode/extensions.json', (json) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,mDAK8B;AAG9B,sDAAsD;AACtD,iEAAsE;AAStE,SAAS,iBAAiB,CAAC,IAAU;;;IACnC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,iBAAiB,GAAG,MAAA,MAAM,CAAC,WAAW,0CAAE,UAAU,CAAC;IACzD,IAAI,iBAAiB,EAAE;QACrB,wBAAwB;QACxB,iBAAiB,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QACxD,iBAAiB;QACjB,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;KACxE;IAED,MAAA,MAAM,CAAC,cAAc,oCAArB,MAAM,CAAC,cAAc,GAAK,EAAE,EAAC;IAE7B,YAAA,MAAM,CAAC,cAAc,EAAC,IAAI,uCAAJ,IAAI,GAAK,EAAE,EAAC;IAClC,YAAA,MAAM,CAAC,cAAc,CAAC,IAAI,EAAC,MAAM,uCAAN,MAAM,GAAK;QACpC,SAAS;QACT,gCAAgC;
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,mDAK8B;AAG9B,sDAAsD;AACtD,iEAAsE;AAStE,SAAS,iBAAiB,CAAC,IAAU;;;IACnC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,iBAAiB,GAAG,MAAA,MAAM,CAAC,WAAW,0CAAE,UAAU,CAAC;IACzD,IAAI,iBAAiB,EAAE;QACrB,wBAAwB;QACxB,iBAAiB,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QACxD,iBAAiB;QACjB,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;KACxE;IAED,MAAA,MAAM,CAAC,cAAc,oCAArB,MAAM,CAAC,cAAc,GAAK,EA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AAO,CAAC,eAAe;QAC7B,CAAC,CAAC,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF;YACE,cAAc,EAAE,oBAAS;YACzB,wBAAwB,EAAE,oBAAS;YACnC,2BAA2B,EAAE,kCAAuB;YACpD,kCAAkC,EAAE,kCAAuB;YAC3D,MAAM,EAAE,wBAAa;YACrB,wBAAwB,EAAE,sCAA2B;SACtD,CACF;QACH,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;AACf,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAA0B;IACtE,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAFD,8CAEC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getEslintTargets = void 0;
|
4
|
+
const executor_options_utils_1 = require("@nrwl/workspace/src/utilities/executor-options-utils");
|
5
|
+
function getEslintTargets(tree) {
|
6
|
+
const eslintTargetNames = new Set();
|
7
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/linter:eslint', (_, __, target) => {
|
8
|
+
eslintTargetNames.add(target);
|
9
|
+
});
|
10
|
+
return eslintTargetNames;
|
11
|
+
}
|
12
|
+
exports.getEslintTargets = getEslintTargets;
|
13
|
+
//# sourceMappingURL=eslint-targets.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"eslint-targets.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/eslint-targets.ts"],"names":[],"mappings":";;;AACA,iGAA8F;AAE9F,SAAgB,gBAAgB,CAAC,IAAU;IACzC,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;AAND,4CAMC"}
|
@@ -3,7 +3,7 @@ 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
|
6
|
+
const js_1 = require("@nrwl/js");
|
7
7
|
const path_1 = require("path");
|
8
8
|
const workspace_lint_rules_1 = require("../../utils/workspace-lint-rules");
|
9
9
|
const versions_1 = require("nx/src/utils/versions");
|
@@ -13,7 +13,7 @@ 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
|
-
|
16
|
+
(0, devkit_1.ensurePackage)(tree, '@nrwl/jest/', versions_2.nxVersion);
|
17
17
|
const { addPropertyToJestConfig, jestProjectGenerator } = yield Promise.resolve().then(() => require('@nrwl/jest'));
|
18
18
|
// Noop if the workspace rules project already exists
|
19
19
|
try {
|
@@ -31,7 +31,7 @@ function lintWorkspaceRulesProjectGenerator(tree) {
|
|
31
31
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), workspace_lint_rules_1.workspaceLintPluginDir, {
|
32
32
|
tmpl: '',
|
33
33
|
offsetFromRoot: (0, devkit_1.offsetFromRoot)(exports.WORKSPACE_PLUGIN_DIR),
|
34
|
-
rootTsConfigPath: (0,
|
34
|
+
rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(tree, exports.WORKSPACE_PLUGIN_DIR),
|
35
35
|
});
|
36
36
|
/**
|
37
37
|
* Ensure that when workspace rules are updated they cause all projects to be affected for now.
|
@@ -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,yCAcsB;AACtB,
|
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,iCAAyD;AACzD,+BAA4B;AAC5B,2EAA0E;AAC1E,oDAAuE;AACvE,mDAAiD;AAEpC,QAAA,4BAA4B,GAAG,cAAc,CAAC;AAE9C,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD,SAAsB,kCAAkC,CAAC,IAAU;;;QACjE,IAAA,sBAAa,EAAC,IAAI,EAAE,aAAa,EAAE,oBAAS,CAAC,CAAC;QAC9C,MAAM,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,GAAG,2CACxD,YAAY,EACb,CAAC;QAEF,qDAAqD;QACrD,IAAI;YACF,IAAA,iCAAwB,EAAC,IAAI,EAAE,oCAA4B,CAAC,CAAC;YAC7D,OAAO;SACR;QAAC,WAAM,GAAE;QAEV,2EAA2E;QAC3E,IAAA,gCAAuB,EAAC,IAAI,EAAE,oCAA4B,EAAE;YAC1D,IAAI,EAAE,4BAAoB;YAC1B,UAAU,EAAE,4BAAoB;YAChC,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,8BAA8B;QAC9B,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,6CAAsB,EAAE;YACpE,IAAI,EAAE,EAAE;YACR,cAAc,EAAE,IAAA,uBAAc,EAAC,4BAAoB,CAAC;YACpD,gBAAgB,EAAE,IAAA,kCAA6B,EAAC,IAAI,EAAE,4BAAoB,CAAC;SAC5E,CAAC,CAAC;QAEH;;;WAGG;QACH,MAAM,MAAM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BACX,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;QAEF,uBAAuB;QACvB,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF,EAAE,oBAAoB,EAAE,yBAAc,EAAE,WAAW,EAAE,yBAAc,EAAE,CACtE,CAAC;QAEF,kGAAkG;QAClG,uBAAuB,CACrB,IAAI,EACJ,IAAA,0BAAiB,EAAC,4BAAoB,EAAE,gBAAgB,CAAC,EACzD,kBAAkB,EAClB;YACE,kBAAkB,EAAE,8CAA8C;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"}
|
@@ -7,7 +7,7 @@ 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
|
-
|
10
|
+
(0, devkit_1.ensurePackage)(tree, '@nrwl/jest/', versions_1.nxVersion);
|
11
11
|
const { addPropertyToJestConfig } = yield Promise.resolve().then(() => require('@nrwl/jest'));
|
12
12
|
const existingJestConfigPath = (0, devkit_1.normalizePath)('tools/eslint-rules/jest.config.js');
|
13
13
|
// Add extra config to the jest.config.js file to allow ESLint 8 exports mapping to work with jest
|
@@ -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,yCAMsB;AACtB,uDAAoD;AACpD,mDAAiD;AAEjD,SAA8B,cAAc,CAAC,IAAU;;QACrD,IAAI;YACF,
|
1
|
+
{"version":3,"file":"eslint-8-updates.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-13-3-0/eslint-8-updates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AAC;iBACP;gBACD,MAAM,eAAe,GACnB,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,8BAA8B,CAAC,YAAY,EAAE,CAAC;oBACpE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAAC,WAAM,GAAE;IACZ,CAAC;CAAA;AA9CD,iCA8CC"}
|
@@ -2,8 +2,8 @@
|
|
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 executor_options_utils_1 = require("@nrwl/workspace/src/utilities/executor-options-utils");
|
6
5
|
const eslint_file_1 = require("../../generators/utils/eslint-file");
|
6
|
+
const eslint_targets_1 = require("../../generators/utils/eslint-targets");
|
7
7
|
function addEslintInputs(tree) {
|
8
8
|
var _a, _b, _c, _d;
|
9
9
|
var _e;
|
@@ -15,7 +15,7 @@ function addEslintInputs(tree) {
|
|
15
15
|
productionFileset.add(`!{projectRoot}/${globalEslintFile}`);
|
16
16
|
nxJson.namedInputs.production = Array.from(productionFileset);
|
17
17
|
}
|
18
|
-
for (const targetName of getEslintTargets(tree)) {
|
18
|
+
for (const targetName of (0, eslint_targets_1.getEslintTargets)(tree)) {
|
19
19
|
(_b = nxJson.targetDefaults) !== null && _b !== void 0 ? _b : (nxJson.targetDefaults = {});
|
20
20
|
const lintTargetDefaults = ((_c = (_e = nxJson.targetDefaults)[targetName]) !== null && _c !== void 0 ? _c : (_e[targetName] = {}));
|
21
21
|
(_d = lintTargetDefaults.inputs) !== null && _d !== void 0 ? _d : (lintTargetDefaults.inputs = [
|
@@ -30,11 +30,4 @@ function addEslintInputs(tree) {
|
|
30
30
|
});
|
31
31
|
}
|
32
32
|
exports.default = addEslintInputs;
|
33
|
-
function getEslintTargets(tree) {
|
34
|
-
const eslintTargetNames = new Set();
|
35
|
-
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/linter:eslint', (_, __, target) => {
|
36
|
-
eslintTargetNames.add(target);
|
37
|
-
});
|
38
|
-
return eslintTargetNames;
|
39
|
-
}
|
40
33
|
//# sourceMappingURL=add-eslint-inputs.js.map
|
@@ -1 +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,yCAMsB;AACtB,
|
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,yCAMsB;AACtB,oEAA+E;AAC/E,0EAAyE;AAEzE,SAA8B,eAAe,CAAC,IAAU;;;;QACtD,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;QAEhC,MAAM,gBAAgB,GAAG,uCAAyB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;QAEF,IAAI,gBAAgB,KAAI,MAAA,MAAM,CAAC,WAAW,0CAAE,UAAU,CAAA,EAAE;YACtD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAEjE,iBAAiB,CAAC,GAAG,CAAC,kBAAkB,gBAAgB,EAAE,CAAC,CAAC;YAE5D,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SAC/D;QAED,KAAK,MAAM,UAAU,IAAI,IAAA,iCAAgB,EAAC,IAAI,CAAC,EAAE;YAC/C,MAAA,MAAM,CAAC,cAAc,oCAArB,MAAM,CAAC,cAAc,GAAK,EAAE,EAAC;YAE7B,MAAM,kBAAkB,GAAG,aAAC,MAAM,CAAC,cAAc,EAAC,UAAU,wCAAV,UAAU,IAAM,EAAE,EAAC,CAAC;YAEtE,MAAA,kBAAkB,CAAC,MAAM,oCAAzB,kBAAkB,CAAC,MAAM,GAAK;gBAC5B,SAAS;gBACT,GAAG,CAAC,gBAAgB;oBAClB,CAAC,CAAC,CAAC,IAAA,0BAAiB,EAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;oBAC1D,CAAC,CAAC,EAAE,CAAC;aACR,EAAC;SACH;QAED,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE3B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AA/BD,kCA+BC"}
|
@@ -0,0 +1,42 @@
|
|
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 eslint_file_1 = require("../../generators/utils/eslint-file");
|
6
|
+
const eslint_targets_1 = require("../../generators/utils/eslint-targets");
|
7
|
+
function addEslintIgnore(tree) {
|
8
|
+
var _a, _b;
|
9
|
+
var _c;
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
11
|
+
const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
|
12
|
+
const globalEslintFile = eslint_file_1.eslintConfigFileWhitelist.find((file) => tree.exists(file));
|
13
|
+
if (globalEslintFile) {
|
14
|
+
if (tree.exists('.eslintignore')) {
|
15
|
+
const content = tree.read('.eslintignore', 'utf-8');
|
16
|
+
if (!content.includes('node_modules')) {
|
17
|
+
tree.write('.eslintignore', `node_modules\n${content}`);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
else {
|
21
|
+
tree.write('.eslintignore', 'node_modules\n');
|
22
|
+
}
|
23
|
+
for (const targetName of (0, eslint_targets_1.getEslintTargets)(tree)) {
|
24
|
+
(_a = nxJson.targetDefaults) !== null && _a !== void 0 ? _a : (nxJson.targetDefaults = {});
|
25
|
+
const lintTargetDefaults = ((_b = (_c = nxJson.targetDefaults)[targetName]) !== null && _b !== void 0 ? _b : (_c[targetName] = {}));
|
26
|
+
const lintIgnorePath = (0, devkit_1.joinPathFragments)('{workspaceRoot}', globalEslintFile);
|
27
|
+
if (lintTargetDefaults.inputs) {
|
28
|
+
if (!lintTargetDefaults.inputs.includes(lintIgnorePath)) {
|
29
|
+
lintTargetDefaults.inputs.push(lintIgnorePath);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
lintTargetDefaults.inputs = ['default', lintIgnorePath];
|
34
|
+
}
|
35
|
+
}
|
36
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
37
|
+
yield (0, devkit_1.formatFiles)(tree);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
}
|
41
|
+
exports.default = addEslintIgnore;
|
42
|
+
//# sourceMappingURL=add-eslint-ignore.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"add-eslint-ignore.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,oEAA+E;AAC/E,0EAAyE;AAEzE,SAA8B,eAAe,CAAC,IAAU;;;;QACtD,MAAM,MAAM,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAEzC,MAAM,gBAAgB,GAAG,uCAAyB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;QAEF,IAAI,gBAAgB,EAAE;YACpB,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;gBAChC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBACpD,IAA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