diff --git a/src/rules/converters/codelyzer/no-attribute-decorator.ts b/src/rules/converters/codelyzer/no-attribute-decorator.ts new file mode 100644 index 000000000..2b3cbc2b4 --- /dev/null +++ b/src/rules/converters/codelyzer/no-attribute-decorator.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../../converter"; + +export const convertNoAttributeDecorator: RuleConverter = () => { + return { + rules: [ + { + ruleName: "@angular-eslint/no-attribute-decorator", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }; +}; diff --git a/src/rules/converters/codelyzer/tests/no-attribute-decorator.test.ts b/src/rules/converters/codelyzer/tests/no-attribute-decorator.test.ts new file mode 100644 index 000000000..1740779ef --- /dev/null +++ b/src/rules/converters/codelyzer/tests/no-attribute-decorator.test.ts @@ -0,0 +1,18 @@ +import { convertNoAttributeDecorator } from "../no-attribute-decorator"; + +describe(convertNoAttributeDecorator, () => { + test("conversion without arguments", () => { + const result = convertNoAttributeDecorator({ + ruleArguments: [], + }); + + expect(result).toEqual({ + rules: [ + { + ruleName: "@angular-eslint/no-attribute-decorator", + }, + ], + plugins: ["@angular-eslint/eslint-plugin"], + }); + }); +}); diff --git a/src/rules/rulesConverters.ts b/src/rules/rulesConverters.ts index 6dba3e6fb..b58c01186 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 { convertNoAttributeDecorator } from "./converters/codelyzer/no-attribute-decorator"; import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator"; /** @@ -192,6 +193,7 @@ export const rulesConverters = new Map([ ["no-any", convertNoExplicitAny], ["no-arg", convertNoArg], ["no-async-without-await", convertNoAsyncWithoutAwait], + ["no-attribute-decorator", convertNoAttributeDecorator], ["no-banned-terms", convertNoBannedTerms], ["no-bitwise", convertNoBitwise], ["no-boolean-literal-compare", convertNoBooleanLiteralCompare],