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(eslint-plugin-template): no-call-expression not reporting failures for safe method c… #269

Merged
merged 2 commits into from Dec 31, 2020

Conversation

rafaelss95
Copy link
Member

…alls

As reported in mgechev/codelyzer#757, no-call-expression doesn't report failures for safe method calls, e.g.:

{{ a?.b() }}

About mgechev/codelyzer#757 (comment), I don't know if we would be able to perform this check without turn the requiresTypeChecking on...

Comment on lines -41 to -48
convertAnnotatedSourceToFailureCase({
description: 'it should fail with call expression in expression binding',
annotatedSource: `
<a href="http://example.com">{{ getInfo() }}</a>
~~~~~~~~~
`,
messageId,
}),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as duplicated test.

Comment on lines +61 to +60
{{ obj?.nested1() }} {{ obj!.nested1() }}
~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JamesHenry, 2 points to notice here:

  • While I was doing this, I remembered that we discussed this at feat(eslint-plugin-template): no-any #205 (comment), so I decided to debug deeper this time and finally figured out why it happens. The "problem" is that Angular condenses consequent interpolations in a single BoundText, and so in order to check the error by passing a char, we should inline all the interpolations in a single line.

Captura de Tela 2020-12-25 às 15 50 58

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.

None yet

2 participants