From 80d4412b6625d0915ace2d3dda51652ec9548fea Mon Sep 17 00:00:00 2001 From: KingDarBoja Date: Sat, 9 May 2020 15:07:25 -0500 Subject: [PATCH] Add codelyzer no-host-metadata-property converter --- .../codelyzer/no-host-metadata-property.ts | 12 ++++++++++++ .../tests/no-host-metadata-property.test.ts | 18 ++++++++++++++++++ src/rules/rulesConverters.ts | 4 +++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/rules/converters/codelyzer/no-host-metadata-property.ts create mode 100644 src/rules/converters/codelyzer/tests/no-host-metadata-property.test.ts diff --git a/src/rules/converters/codelyzer/no-host-metadata-property.ts b/src/rules/converters/codelyzer/no-host-metadata-property.ts new file mode 100644 index 000000000..81537d352 --- /dev/null +++ b/src/rules/converters/codelyzer/no-host-metadata-property.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../../converter"; + +export const convertNoHostMetadataProperty: RuleConverter = () => { + return { + rules: [ + { + ruleName: "@angular-eslint/no-host-metadata-property", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }; +}; diff --git a/src/rules/converters/codelyzer/tests/no-host-metadata-property.test.ts b/src/rules/converters/codelyzer/tests/no-host-metadata-property.test.ts new file mode 100644 index 000000000..8b6a92431 --- /dev/null +++ b/src/rules/converters/codelyzer/tests/no-host-metadata-property.test.ts @@ -0,0 +1,18 @@ +import { convertNoHostMetadataProperty } from "../no-host-metadata-property"; + +describe(convertNoHostMetadataProperty, () => { + test("conversion without arguments", () => { + const result = convertNoHostMetadataProperty({ + ruleArguments: [], + }); + + expect(result).toEqual({ + rules: [ + { + ruleName: "@angular-eslint/no-host-metadata-property", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }); + }); +}); diff --git a/src/rules/rulesConverters.ts b/src/rules/rulesConverters.ts index b39115c08..0d7980265 100644 --- a/src/rules/rulesConverters.ts +++ b/src/rules/rulesConverters.ts @@ -146,6 +146,7 @@ import { convertDirectiveClassSuffix } from "./converters/codelyzer/directive-cl import { convertDirectiveSelector } from "./converters/codelyzer/directive-selector"; import { convertNoAttributeDecorator } from "./converters/codelyzer/no-attribute-decorator"; import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator"; +import { convertNoHostMetadataProperty } from "./converters/codelyzer/no-host-metadata-property"; /** * Keys TSLint rule names to their ESLint rule converters. @@ -218,8 +219,9 @@ export const rulesConverters = new Map([ ["no-eval", convertNoEval], ["no-floating-promises", convertNoFloatingPromises], ["no-for-in-array", convertNoForInArray], - ["no-implicit-dependencies", convertNoImplicitDependencies], ["no-for-in", convertNoForIn], + ["no-host-metadata-property", convertNoHostMetadataProperty], + ["no-implicit-dependencies", convertNoImplicitDependencies], ["no-import-side-effect", convertNoImportSideEffect], ["no-inferrable-types", convertNoInferrableTypes], ["no-internal-module", convertNoInternalModule],