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

[no-call-expression] Add support for including/excluding specific functions #1055

Closed
2 tasks
AbdealiLoKo opened this issue Jun 22, 2022 · 1 comment · Fixed by #1217
Closed
2 tasks

[no-call-expression] Add support for including/excluding specific functions #1055

AbdealiLoKo opened this issue Jun 22, 2022 · 1 comment · Fixed by #1217
Labels
package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer

Comments

@AbdealiLoKo
Copy link

Description and reproduction of the issue
I am trying to avoid using form.get(...) in my templates and force my team to use form.controls. in the HTML templates.
And I came across this rule - which is pretty awesome.

But I realized I get a lot of false positives - because some library maintainers recommend using their functions in the template:
https://ngneat.github.io/transloco/docs/translation-in-the-template#structural-directive

And they have said that the function is optimized and created to be used in templates efficiently (via memoization etc)

So, my request is - can we enable/disable certain calls based on the name of the function ?
Maybe a includeNames/excludeNames optional configuration for this rule ?

Versions

package version
@angular-eslint/eslint-plugin-template 13.0.1
@angular-eslint/template-parser 13.0.1
@typescript-eslint/parser 5.29.0
ESLint 8.18.0
node 16.13.2
# Please run `npx ng version` in your project and paste the full output here:

$ npx ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.0.0
Node: 16.13.2
Package Manager: npm 8.1.2
OS: linux x64

Angular: 14.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1400.0
@angular-devkit/build-angular   14.0.0
@angular-devkit/core            14.0.0
@angular-devkit/schematics      14.0.0
@schematics/angular             14.0.1
rxjs                            7.5.5
typescript                      4.7.3
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest supported version of the packages and checked my ng version output per the instructions given here.
@AbdealiLoKo AbdealiLoKo added package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer labels Jun 22, 2022
@theorlovsky
Copy link

would be really nice to see it in a future version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants