Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 8, 2019
Merged

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

merged 2 commits into from
Mar 8, 2019

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