Replies: 3 comments 6 replies
-
Let me start by introducing my own Angular ESLint rule: ESLint Angular Template consistent this. This rule validates the use of explicit/implicit prefix properties, variables and template references with There is no functional reason to start properties with Example of incorrect property code: <test *ngIf="foo">{{bar}}</test>
~~~ ~~~ Example of correct property code: <test *ngIf="this.foo">{{this.bar}}</test> |
Beta Was this translation helpful? Give feedback.
-
@jerone I'm trying to do the same right now for our company code and feeling huge pain -- zero documentation or guidelines. Basically, the only thing I have is I managed to make a small test rule, but struggled to make it testable with |
Beta Was this translation helpful? Give feedback.
-
@KrystianDerdzinski @reduckted, thank you very much for the information. I have managed to make a package and test rule that works fine so far, but I stumbled upon applying proper testing via
which goes down to
That's how I create the rule
and that's how I create test suite
At the same time, it works fine from the console, but when I add
It looks for me now like a problem with tsconfig/jest config, but I cannot figure out the cause for it. If you faced anything similar that would be realy helpful to get a tip on how to fix it. Does it make any difference what version of ESLint you specify in your |
Beta Was this translation helpful? Give feedback.
-
I'm starting this discussion to create an overview of custom Angular ESLint rules that are not part of this repository.
It is not only about shameless promotion 😁, but also to share examples and discuss implementation issues.
It might be interested to see what others have created.
@maintainers If not allowed, please let me know and I'll delete this discussion.
Beta Was this translation helpful? Give feedback.
All reactions