uxp-linter-test-app
Version:
UXP LINTER is useful for linting your code with ESLint rules and guidelines.
25 lines (20 loc) • 824 B
JavaScript
;
require("v8-compile-cache");
var utils = require('../utils');
const cmdAngular = ["ng add @angular-eslint/schematics",
"ng g @angular-eslint/schematics:convert-tslint-to-eslint your_project_name"];
async function runCmdCommand() {
var angVersion = await utils.getPackageVersion('@angular/core');
for (let j = 0; j < cmdAngular.length; j++) {
var pckgToInstall = cmdAngular[j];
if (j > 0 && angVersion < 12 && pckgToInstall.indexOf('your_project_name') > 0) {
var projName = await utils.getProjectName();
pckgToInstall = pckgToInstall.replace('your_project_name', projName);
}
if (j == 0 || angVersion < 12) {
await utils.executeCommand(pckgToInstall, true);
}
}
}
module.exports = runCmdCommand();