Skip to content

Commit 09fe82f

Browse files
crisbetojelbourn
authored andcommitted
build: decorator validation rule skipping property check if next line is disabled (#17569)
Fixes the decorator validation rule skipping all of the property presence checks if there's a `disable-next-line` inside the object literal. The problem comes from the fact that if the check fails, we report a failure on the entire decorator node. These changes switch to reporting the failure only on the name.
1 parent e91589c commit 09fe82f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/tslint-rules/validateDecoratorsRule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ class Walker extends Lint.RuleWalker {
114114

115115
if (missing.length) {
116116
// Exit early if any of the properties are missing.
117-
this.addFailureAtNode(decorator.parent, 'Missing required properties: ' + missing.join(', '));
117+
this.addFailureAtNode(decorator.expression,
118+
'Missing required properties: ' + missing.join(', '));
118119
} else {
119120
// If all the necessary properties are defined, ensure that
120121
// they match the pattern and aren't in the forbidden list.

0 commit comments

Comments
 (0)