EmmanuelDemey / EmmanuelDemey/eslint-plugin-angular

on-watch rule triggers on `return`

Open
#519 0 comments 0 reactions 0 assignees View on GitHub
Hacktoberfest Improvement
Dominant language
JavaScript
Stars
620
Forks
127
PR merge metrics
No merged PRs in 30d

Description

`return` statement must be treated equivalent to an assignment for the purpose of the **on-watch** rule.

My use case involves returning a function that ends with `return $rootScope.$on(...)` from a service into a controller. I can use the return value with the `'$destroy'` event. I know the workaround is to place `$rootscope.$on()` in the controller but with my method I can avoid a `$rootScope` DI in the controller.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.