{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/11025","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/11025/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/11025/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/11025/events","html_url":"https://github.com/eslint/eslint/issues/11025","id":374479742,"node_id":"MDU6SXNzdWUzNzQ0Nzk3NDI=","number":11025,"title":"Add rule to enforce equals operator alignment","user":{"login":"iandunn","id":484068,"node_id":"MDQ6VXNlcjQ4NDA2OA==","avatar_url":"https://avatars3.githubusercontent.com/u/484068?v=4","gravatar_id":"","url":"https://api.github.com/users/iandunn","html_url":"https://github.com/iandunn","followers_url":"https://api.github.com/users/iandunn/followers","following_url":"https://api.github.com/users/iandunn/following{/other_user}","gists_url":"https://api.github.com/users/iandunn/gists{/gist_id}","starred_url":"https://api.github.com/users/iandunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iandunn/subscriptions","organizations_url":"https://api.github.com/users/iandunn/orgs","repos_url":"https://api.github.com/users/iandunn/repos","events_url":"https://api.github.com/users/iandunn/events{/privacy}","received_events_url":"https://api.github.com/users/iandunn/received_events","type":"User","site_admin":false},"labels":[{"id":45711354,"node_id":"MDU6TGFiZWw0NTcxMTM1NA==","url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-26T17:35:20Z","updated_at":"2018-10-26T17:41:10Z","closed_at":null,"author_association":"NONE","body":"**Please describe what the rule should do:**\r\n\r\nIf enabled, the rule should produce a warning when consecutive assignment statements do not have the assignment operator aligned.\r\n\r\nThis would be similar to using `key-spacing` with `align: colon`.\r\n\r\nOptionally, it could be expanded beyond the `=` operator, to include things like aligning the `from` keyword in imports, and similar situations.\r\n\r\n\r\n**What category of rule is this? (place an \"X\" next to just one item)**\r\n\r\n[x] Enforces code style\r\n[ ] Warns about a potential error\r\n[ ] Suggests an alternate way of doing something\r\n[ ] Other (please specify:)\r\n\r\n**Provide 2-3 code examples that this rule will warn about:**\r\n\r\nInvalid:\r\n```js\r\nconst { withSelect } = wp.data;\r\nconst { InspectorControls } = wp.editor;\r\nconst { Component, Fragment, RawHTML } = wp.element;\r\n```\r\n\r\nValid:\r\n```js\r\n// Single statements would be ignored\r\nconst { __ } = wp.i18n;\r\n\r\n// Consecutive statements would have to be aligned\r\nconst { withSelect }                   = wp.data;\r\nconst { InspectorControls }            = wp.editor;\r\nconst { Component, Fragment, RawHTML } = wp.element;\r\n```\r\n\r\nInvalid:\r\n```js\r\nimport classnames from 'classnames';\r\nimport { isUndefined, pickBy, split } from 'lodash';\r\n```\r\n\r\nValid:\r\n```js\r\n// Single statements would be ignored\r\nimport edit from './edit.jsx';\r\n\r\n// Consecutive statements would have to be aligned\r\nimport classnames                     from 'classnames';\r\nimport { isUndefined, pickBy, split } from 'lodash';\r\n```\r\n\r\n**Why should this rule be included in ESLint (instead of a plugin)?**\r\n\r\nIt passes all of the tests:\r\n\r\n* *Widely applicable*: This seems like a common style guideline, but I wasn't able to find any way to enforce it. While searching, I noticed [others](https://stackoverflow.com/questions/52026170/is-there-an-eslint-rule-to-align-on-assignments) trying to achieve [the same thing](https://stackoverflow.com/questions/52718055/eslintrc-json-no-multi-spaces-value-assignment-equal-sign-aligned-javascript) with no solution.\r\n* *Generic*: Yes\r\n* *Atomic*: Yes\r\n* *Unique*: There are some related rules, but none that would produce an error when the operators aren't aligned.\r\n* *Library agnostic*: Yes\r\n* *No conflicts*: There are some related rules (e.g., `no-multi-spaces`), but they can be configured in a way that doesn't produce any errors when the operators are aligned.\r\n\r\n**Are you willing to submit a pull request to implement this rule?**\r\n\r\nI don't have enough time right now, but possibly in the future."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/433487713","html_url":"https://github.com/eslint/eslint/issues/11025#issuecomment-433487713","issue_url":"https://api.github.com/repos/eslint/eslint/issues/11025","id":433487713,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzQ4NzcxMw==","user":{"login":"ljharb","id":45469,"node_id":"MDQ6VXNlcjQ1NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T17:41:10Z","updated_at":"2018-10-26T17:41:10Z","author_association":"CONTRIBUTOR","body":"Are there any common style guides that recommend alignment like this? It seems common in other languages, but the idiomatic JS i've seen recommends strictly avoiding alignment like this."}}
{"actor":{"display_login":"ljharb"}}