UNPKG

@nrwl/schematics

Version:

Extensible Dev Tools for Monorepos: Schematics

20 lines (19 loc) 797 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const workspace_1 = require("@nrwl/workspace"); exports.default = { description: 'Update the schema file to reflect the `allow` option for `nx-enforce-module-boundaries`.', run: () => { workspace_1.updateJsonFile('tslint.json', json => { const ruleName = 'nx-enforce-module-boundaries'; const ruleOptionName = 'allow'; const rule = ruleName in json.rules ? json.rules[ruleName] : null; // Only modify when the rule is configured with optional arguments if (Array.isArray(rule) && typeof rule[1] === 'object' && rule[1] !== null) { rule[1][ruleOptionName] = []; } }); } };