{"action":"created","issue":{"url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/409","repository_url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular","labels_url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/409/labels{/name}","comments_url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/409/comments","events_url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/409/events","html_url":"https://github.com/Gillespie59/eslint-plugin-angular/issues/409","id":168852997,"number":409,"title":"`no-run-logic`: allow arguments to be nested","user":{"login":"jrencz","id":948356,"avatar_url":"https://avatars.githubusercontent.com/u/948356?v=3","gravatar_id":"","url":"https://api.github.com/users/jrencz","html_url":"https://github.com/jrencz","followers_url":"https://api.github.com/users/jrencz/followers","following_url":"https://api.github.com/users/jrencz/following{/other_user}","gists_url":"https://api.github.com/users/jrencz/gists{/gist_id}","starred_url":"https://api.github.com/users/jrencz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrencz/subscriptions","organizations_url":"https://api.github.com/users/jrencz/orgs","repos_url":"https://api.github.com/users/jrencz/repos","events_url":"https://api.github.com/users/jrencz/events{/privacy}","received_events_url":"https://api.github.com/users/jrencz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-02T10:36:23Z","updated_at":"2016-08-02T10:38:19Z","closed_at":null,"body":"Currently it's not possible to use the rule with the following:\r\n\r\n```js\r\nangular\r\n  .module('foo', [\r\n    'config',\r\n    'someLogicModule',\r\n  ])\r\n  \r\n  .run(function (\r\n    someLogic,\r\n    config\r\n  ) {\r\n    someLogic(config.foo.bar.baz);\r\n  })\r\n```\r\n\r\nRationale:\r\nIn my project I have configuration built from many sources in CD. `config` module is created dynamically. I only allow `run` blocks to import `config` constant but the constant itself is nested (it's created from JSON objects). I chose to expose those things to DI under a common name to prevent naming collisions.\r\n\r\nI'm striding towards applying this rule, but this really holds me back: I want to keep the architectural decision of NOT injecting `config` directly to services providing logic. On the other hand the only thing I can do with the rule enabled is:\r\n\r\n```js\r\n  .run(function (\r\n    someLogic,\r\n    config\r\n  ) {\r\n    someLogic(config); // and handle `foo.bar.baz` inside\r\n  })\r\n```\r\n\r\nwhich gives `someLogic` too much power.\r\n\r\n\r\nI suggest there should be a setting that will optionally allow passing values nested in DI objects."},"comment":{"url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/comments/236867757","html_url":"https://github.com/Gillespie59/eslint-plugin-angular/issues/409#issuecomment-236867757","issue_url":"https://api.github.com/repos/Gillespie59/eslint-plugin-angular/issues/409","id":236867757,"user":{"login":"jrencz","id":948356,"avatar_url":"https://avatars.githubusercontent.com/u/948356?v=3","gravatar_id":"","url":"https://api.github.com/users/jrencz","html_url":"https://github.com/jrencz","followers_url":"https://api.github.com/users/jrencz/followers","following_url":"https://api.github.com/users/jrencz/following{/other_user}","gists_url":"https://api.github.com/users/jrencz/gists{/gist_id}","starred_url":"https://api.github.com/users/jrencz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrencz/subscriptions","organizations_url":"https://api.github.com/users/jrencz/orgs","repos_url":"https://api.github.com/users/jrencz/repos","events_url":"https://api.github.com/users/jrencz/events{/privacy}","received_events_url":"https://api.github.com/users/jrencz/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T10:38:19Z","updated_at":"2016-08-02T10:38:19Z","body":"This rule should also allow logic services to take named params (I mean ES2015 destructuring):\r\n\r\n```js\r\n  .run(function (\r\n    someLogic,\r\n    config\r\n  ) {\r\n    someLogic({\r\n      foo: 1,\r\n      bar: 42\r\n    }); // those are still simple arguments but `someLogic` takes them as named arguments\r\n  })\r\n```"}}
{"actor":{"display_login":"jrencz"}}