UNPKG

@nx/angular

Version:

The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypre

35 lines (34 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = default_1; const devkit_1 = require("@nx/devkit"); // https://github.com/angular-eslint/angular-eslint/blob/24a4de54a8991c93924abf1dfb78b132a6269aef/packages/schematics/src/migrations/update-16-0-0/update-16-0-0.ts async function default_1(tree) { (0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => { if (!filePath.endsWith('.eslintrc.json')) { return; } (0, devkit_1.updateJson)(tree, filePath, (json) => { if (json.overrides) { for (const override of json.overrides) { modifyRules(override); } } modifyRules(json); return json; }); }); await (0, devkit_1.formatFiles)(tree); } function modifyRules(parent) { if (!parent.rules) { return; } for (const rule of Object.keys(parent.rules)) { if (rule.startsWith('@angular-eslint/template/accessibility-')) { const ruleConfig = parent.rules[rule]; parent.rules[rule.replace('@angular-eslint/template/accessibility-', '@angular-eslint/template/')] = ruleConfig; delete parent.rules[rule]; } } }