Skip to content

Commit

Permalink
Remove usage of the deprecated TslintFixTask
Browse files Browse the repository at this point in the history
Fixes #320
  • Loading branch information
devoto13 committed Sep 12, 2021
1 parent c85caf8 commit eb67731
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions projects/schematics/src/ng-add/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { workspaces } from '@angular-devkit/core';
import { chain, Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
import { NodePackageInstallTask, TslintFixTask } from '@angular-devkit/schematics/tasks';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
import {
createSourceFile,
ScriptTarget,
Expand Down Expand Up @@ -46,7 +46,7 @@ export default function (options: Schema): Rule {
}

function addModule(options: Schema): Rule {
return async (host: Tree, context: SchematicContext) => {
return async (host: Tree) => {
const workspace = await getWorkspace(host);
const projectName = options.project ?? (workspace.extensions.defaultProject as string);
const project = workspace.projects.get(projectName);
Expand All @@ -69,14 +69,6 @@ function addModule(options: Schema): Rule {
}
});
host.commitUpdate(recorder);

/* tslint is required to add a tslint fix task */
try {
require('tslint');
context.addTask(new TslintFixTask(modulePath, {}));
} catch (err) {
context.logger.warn('Formatting was skipped because tslint is not installed.');
}
};
}

Expand Down

0 comments on commit eb67731

Please sign in to comment.