Skip to content

Commit 5be49eb

Browse files
KingDarBojaJosh Goldberg
and
Josh Goldberg
authored
Add codelyzer no-attribute-decorator converter (#459)
Co-authored-by: Josh Goldberg <joshuakgoldberg@outlook.com>
1 parent 7e3bd82 commit 5be49eb

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleConverter } from "../../converter";
2+
3+
export const convertNoAttributeDecorator: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "@angular-eslint/no-attribute-decorator",
8+
},
9+
],
10+
plugins: ["@angular-eslint/eslint-plugin"],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertNoAttributeDecorator } from "../no-attribute-decorator";
2+
3+
describe(convertNoAttributeDecorator, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoAttributeDecorator({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "@angular-eslint/no-attribute-decorator",
13+
},
14+
],
15+
plugins: ["@angular-eslint/eslint-plugin"],
16+
});
17+
});
18+
});

src/rules/rulesConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ import { convertComponentClassSuffix } from "./converters/codelyzer/component-cl
142142
import { convertComponentMaxInlineDeclarations } from "./converters/codelyzer/component-max-inline-declarations";
143143
import { convertComponentSelector } from "./converters/codelyzer/component-selector";
144144
import { convertContextualLifecycle } from "./converters/codelyzer/contextual-lifecycle";
145+
import { convertNoAttributeDecorator } from "./converters/codelyzer/no-attribute-decorator";
145146
import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator";
146147

147148
/**
@@ -192,6 +193,7 @@ export const rulesConverters = new Map([
192193
["no-any", convertNoExplicitAny],
193194
["no-arg", convertNoArg],
194195
["no-async-without-await", convertNoAsyncWithoutAwait],
196+
["no-attribute-decorator", convertNoAttributeDecorator],
195197
["no-banned-terms", convertNoBannedTerms],
196198
["no-bitwise", convertNoBitwise],
197199
["no-boolean-literal-compare", convertNoBooleanLiteralCompare],

0 commit comments

Comments
 (0)