Skip to content

Commit 7363750

Browse files
committed
refactor(lint): use ready-made util for decorator prop check
1 parent e1a37d7 commit 7363750

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

projects/igniteui-angular/rules/boolean-input-transform.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,7 @@ export const rule = ESLintUtils.RuleCreator.withoutDocs({
9494
if (comments.some(x => x.value.includes('@hidden') || x.value.includes('@internal')))
9595
return;
9696

97-
const arg = decorator.expression.arguments[0];
98-
const hasTransform =
99-
arg &&
100-
arg.type === 'ObjectExpression' &&
101-
arg.properties.some(
102-
(p) =>
103-
p.key.name === 'transform' &&
104-
p.value.name === 'booleanAttribute'
105-
);
97+
const hasTransform = ASTUtils.getDecoratorProperty(decorator, 'transform')?.value.name === 'booleanAttribute';
10698

10799
if (hasTransform) return;
108100

0 commit comments

Comments
 (0)