Skip to content

fix(rule): 'prefer-inline-decorator' limiting the number of options#787

Merged
mgechev merged 2 commits intomgechev:masterfrom
rafaelss95:refactor/prefer-inline-decorator
Mar 8, 2019
Merged

fix(rule): 'prefer-inline-decorator' limiting the number of options#787
mgechev merged 2 commits intomgechev:masterfrom
rafaelss95:refactor/prefer-inline-decorator

Conversation

@rafaelss95
Copy link
Collaborator

…assed as options

Currently, the rule allows only eight options/decorators to be passed.

@rafaelss95 rafaelss95 requested review from mgechev and wKoza March 8, 2019 01:22
@rafaelss95
Copy link
Collaborator Author

@mgechev @wKoza

Look at this spec:

it('should fail if multiple properties are not on the same line as their decorators', () => {
const source = `
class Test {
@Input('test1')
testVar1: string;
@Input('test2')
testVar2: string;
}
`;
assertFailures(ruleName, source, [
{
endPosition: {
character: 29,
line: 3
},
message: FAILURE_STRING,
startPosition: {
character: 12,
line: 2
}
},
{
endPosition: {
character: 29,
line: 5
},
message: FAILURE_STRING,
startPosition: {
character: 12,
line: 4
}
}
]);
});
});


When I implemented this rule, I had to use assertFailures because when I tried to use assertMultipleAnnotated, I got no failures. Do you know why?

... Btw, the same happens with template-no-call-expression: if you test it using non null assert, for example, like this:

{{ obj!.nested1() }}

... you'll see the failure being reported (in the rule), but in the spec, the error isn't being caught.

Any thoughts?

@mgechev
Copy link
Owner

mgechev commented Mar 8, 2019

@rafaelss95 not sure where this may come from, I haven't hit this issue but sounds like a problem in assertMultipleAnnotated

@mgechev mgechev merged commit 31b2b6a into mgechev:master Mar 8, 2019
@rafaelss95 rafaelss95 deleted the refactor/prefer-inline-decorator branch March 17, 2019 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants