{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/6996","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/6996/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6996/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/6996/events","html_url":"https://github.com/eslint/eslint/issues/6996","id":173625742,"number":6996,"title":"Add a --fix option for quote-props","user":{"login":"not-an-aardvark","id":11638619,"avatar_url":"https://avatars.githubusercontent.com/u/11638619?v=3","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-28T02:35:33Z","updated_at":"2016-09-13T18:17:12Z","closed_at":"2016-09-13T18:17:12Z","body":"I'm using Node v6.4.0 and ESLint v3.4.0.\r\n\r\nIt would be useful to have an autofix option for the `quote-props` rule.\r\n\r\n* If a property is reported because quotes are present and unnecessary, the fixer will remove the quotes.\r\n* If a property is reported because quotes are missing but should be present, the fixer will add quotes. It should probably add double quotes by default (for consistency with the `quotes` rule), and then let the `quotes` rule clean up on the next pass if the user prefers another type of quotes. The fixer will need to account for cases where number literals are used as keys:\r\n\r\n```js\r\nvar myObject = {1e2: \"foo\", 0x123: \"bar\", 123.: \"baz\"};\r\n\r\n// should get fixed to:\r\n\r\nvar myObject = {\"100\": \"foo\", \"291\": \"bar\", \"123\": \"baz\"};\r\n\r\n// but should NOT get fixed to:\r\n\r\nvar myObject = {\"1e2\": \"foo\", \"0x123\": \"bar\", \"123.\": \"baz\"}\r\n```\r\n\r\n* If the `consistent` option is used and errors are reported, I see 3 possible ways to fix the errors:\r\n  1. Add quotes to all the unquoted properties. (I think this option is probably best)\r\n  1. Remove quotes from all quoted properties if possible, otherwise add quotes to all unquoted properties. (I don't think this option is a good idea, because if people want this behavior they can just use `consistent-as-needed`)\r\n  1. Use some heuristic (e.g. the first property) to determine whether to quote everything or to quote nothing.\r\n  \r\n\r\nI would be willing to add this if the issue is accepted."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/246773581","html_url":"https://github.com/eslint/eslint/issues/6996#issuecomment-246773581","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6996","id":246773581,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T18:17:12Z","updated_at":"2016-09-13T18:17:12Z","body":"Let's just discuss directly on #7095 in order to avoid having the conversation in two places."}}
{"actor":{"display_login":"nzakas"}}