diff --git a/src/rules/converters/codelyzer/tests/use-pipe-decorator.test.ts b/src/rules/converters/codelyzer/tests/use-pipe-decorator.test.ts new file mode 100644 index 00000000..8c84a599 --- /dev/null +++ b/src/rules/converters/codelyzer/tests/use-pipe-decorator.test.ts @@ -0,0 +1,18 @@ +import { convertUsePipeDecorator } from "../use-pipe-decorator"; + +describe(convertUsePipeDecorator, () => { + test("conversion without arguments", () => { + const result = convertUsePipeDecorator({ + ruleArguments: [], + }); + + expect(result).toEqual({ + rules: [ + { + ruleName: "@angular-eslint/use-pipe-decorator", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }); + }); +}); diff --git a/src/rules/converters/codelyzer/use-pipe-decorator.ts b/src/rules/converters/codelyzer/use-pipe-decorator.ts new file mode 100644 index 00000000..b1fe01c1 --- /dev/null +++ b/src/rules/converters/codelyzer/use-pipe-decorator.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../../converter"; + +export const convertUsePipeDecorator: RuleConverter = () => { + return { + rules: [ + { + ruleName: "@angular-eslint/use-pipe-decorator", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }; +}; diff --git a/src/rules/rulesConverters.ts b/src/rules/rulesConverters.ts index 86f46038..6dba3e6f 100644 --- a/src/rules/rulesConverters.ts +++ b/src/rules/rulesConverters.ts @@ -142,6 +142,7 @@ import { convertComponentClassSuffix } from "./converters/codelyzer/component-cl import { convertComponentMaxInlineDeclarations } from "./converters/codelyzer/component-max-inline-declarations"; import { convertComponentSelector } from "./converters/codelyzer/component-selector"; import { convertContextualLifecycle } from "./converters/codelyzer/contextual-lifecycle"; +import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator"; /** * Keys TSLint rule names to their ESLint rule converters. @@ -288,6 +289,7 @@ export const rulesConverters = new Map([ ["unnecessary-constructor", convertUnnecessaryConstructor], ["use-default-type-parameter", convertUseDefaultTypeParameter], ["use-isnan", convertUseIsnan], + ["use-pipe-decorator", convertUsePipeDecorator], ["variable-name", convertVariableName], // These converters are all for rules that need more complex option conversions.