{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/8485","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/8485/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/8485/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/8485/events","html_url":"https://github.com/eslint/eslint/issues/8485","id":223028412,"number":8485,"title":"Support different levels of indentation for MemberExpression with indent at indent level 0","user":{"login":"w0rp","id":3518142,"avatar_url":"https://avatars1.githubusercontent.com/u/3518142?v=3","gravatar_id":"","url":"https://api.github.com/users/w0rp","html_url":"https://github.com/w0rp","followers_url":"https://api.github.com/users/w0rp/followers","following_url":"https://api.github.com/users/w0rp/following{/other_user}","gists_url":"https://api.github.com/users/w0rp/gists{/gist_id}","starred_url":"https://api.github.com/users/w0rp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w0rp/subscriptions","organizations_url":"https://api.github.com/users/w0rp/orgs","repos_url":"https://api.github.com/users/w0rp/repos","events_url":"https://api.github.com/users/w0rp/events{/privacy}","received_events_url":"https://api.github.com/users/w0rp/received_events","type":"User","site_admin":false},"labels":[{"id":45711352,"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":255319420,"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0","default":false},{"id":45798639,"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-20T10:58:36Z","updated_at":"2017-04-20T22:05:09Z","closed_at":null,"body":"**Tell us about your environment**\r\n\r\n* **ESLint Version:** v4.0.0-alpha.0\r\n* **Node Version:** v6.4.0\r\n* **npm Version:** yarn v0.21.3\r\n\r\nI have some AngularJS code like so:\r\n\r\n```javascript\r\nangular.module('some.module.string', [])\r\n.component('componentName', {\r\n  controller: function() {\r\n    foo()\r\n      .bar()\r\n  },\r\n})\r\n```\r\n\r\nI would like the code in the global scope _not to be_ up-indented, but I would like method chains inside of my functions _to be_ up-indented. As far as I'm aware, it's not possible to configure `eslint` to enforce this. For now, I am just setting `MemberExpression: \"off\"` for the `indent` rule."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/295936093","html_url":"https://github.com/eslint/eslint/issues/8485#issuecomment-295936093","issue_url":"https://api.github.com/repos/eslint/eslint/issues/8485","id":295936093,"user":{"login":"w0rp","id":3518142,"avatar_url":"https://avatars1.githubusercontent.com/u/3518142?v=3","gravatar_id":"","url":"https://api.github.com/users/w0rp","html_url":"https://github.com/w0rp","followers_url":"https://api.github.com/users/w0rp/followers","following_url":"https://api.github.com/users/w0rp/following{/other_user}","gists_url":"https://api.github.com/users/w0rp/gists{/gist_id}","starred_url":"https://api.github.com/users/w0rp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w0rp/subscriptions","organizations_url":"https://api.github.com/users/w0rp/orgs","repos_url":"https://api.github.com/users/w0rp/repos","events_url":"https://api.github.com/users/w0rp/events{/privacy}","received_events_url":"https://api.github.com/users/w0rp/received_events","type":"User","site_admin":false},"created_at":"2017-04-20T22:05:09Z","updated_at":"2017-04-20T22:05:09Z","body":"Sure, I'll give that a go. I hope this will be informative.\r\n\r\nThanks to everyone for `eslint`, by the way. I swear by it as one of the most powerful development tools in existence.\r\n\r\n**What rule do you want to change?**\r\n\r\n`indent`\r\n\r\n**Does this change cause the rule to produce more or fewer warnings?**\r\n\r\nPossibly the same amount. It depends on the codebase.\r\n\r\n**How will the change be implemented? (New option, new default behavior, etc.)?**\r\n\r\n`MemberExpression` could accept an object, say with two keys `indentSize` and `globalScopeIndentSize`. `globalScopeIndentSize` would allow a different size of indentation to be set for method chains in the global scope.\r\n\r\n(The implementation doesn't really matter, just the ability to configure the right behaviour.)\r\n\r\n**Please provide some example code that this change will affect:**\r\n\r\nThe following code will be permitted:\r\n\r\n```javascript\r\nangular.module('some.module.string', [])\r\n.component('componentName', {\r\n  controller: function() {\r\n    foo()\r\n      .bar()\r\n  },\r\n})\r\n```\r\n\r\nRather than the following being suggested:\r\n\r\n```javascript\r\nangular.module('some.module.string', [])\r\n  .component('componentName', {\r\n    controller: function() {\r\n      foo()\r\n        .bar()\r\n    },\r\n  })\r\n```\r\n\r\nOr the following:\r\n\r\n```javascript\r\nangular.module('some.module.string', [])\r\n.component('componentName', {\r\n  controller: function() {\r\n    foo()\r\n    .bar()\r\n  },\r\n})\r\n```\r\n\r\n**What does the rule currently do for this code?**\r\n\r\nThe `indent` rule can be configured to permit one of the two examples above, but not the first one, without turning the `indent` checks off completely for member chains.\r\n\r\n**What will the rule do after it's changed?**\r\n\r\nThe rule will permit a particular style which can be useful for AngularJS codebases."}}
{"actor":{"display_login":"w0rp"}}