I want to add a lint rule in the angular application. The lint rule will give me a warning/error that anybody should not call the function inside a tag.
<span>call()</span> // will give error/warning in html
I want to add a lint rule in the angular application. The lint rule will give me a warning/error that anybody should not call the function inside a tag.
<span>call()</span> // will give error/warning in html
According to my researching, I would say this is impossible.
If u just want lint the html file, take a look at these libraries: HTMLHint and HTML Eslint
But none of them could check function call.
This rule already exists. Add angular-eslint
to your projekt and use the @angular-eslint/template/no-call-expression
rule.
Here you can find the package: https://github.com/angular-eslint/angular-eslint
Typescript does type checking, and is by no means a code structure validator. Simply put, you can't achieve this with TS and will have to write your own function.