-4

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
JSON Derulo
  • 9,780
  • 7
  • 39
  • 56

3 Answers3

0

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.

feihuang
  • 27
  • 3
  • I didn't downvote, but a reason could be that the question is clearly about Angular, and there is a ESLint plugin for Angular which actually has a rule like this. – JSON Derulo Mar 01 '23 at 09:21
0

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

DerHerrGammler
  • 324
  • 2
  • 9
-2

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.

paddotk
  • 1,359
  • 17
  • 31