{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/tslint/issues/2831","repository_url":"https://api.github.com/repos/palantir/tslint","labels_url":"https://api.github.com/repos/palantir/tslint/issues/2831/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tslint/issues/2831/comments","events_url":"https://api.github.com/repos/palantir/tslint/issues/2831/events","html_url":"https://github.com/palantir/tslint/pull/2831","id":231815297,"node_id":"MDExOlB1bGxSZXF1ZXN0MTIyNzY4MDQ5","number":2831,"title":"object-literal-sort-keys - bugfix & new options","user":{"login":"SteveByerly","id":1393464,"node_id":"MDQ6VXNlcjEzOTM0NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1393464?v=4","gravatar_id":"","url":"https://api.github.com/users/SteveByerly","html_url":"https://github.com/SteveByerly","followers_url":"https://api.github.com/users/SteveByerly/followers","following_url":"https://api.github.com/users/SteveByerly/following{/other_user}","gists_url":"https://api.github.com/users/SteveByerly/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveByerly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveByerly/subscriptions","organizations_url":"https://api.github.com/users/SteveByerly/orgs","repos_url":"https://api.github.com/users/SteveByerly/repos","events_url":"https://api.github.com/users/SteveByerly/events{/privacy}","received_events_url":"https://api.github.com/users/SteveByerly/received_events","type":"User","site_admin":false},"labels":[{"id":239858252,"node_id":"MDU6TGFiZWwyMzk4NTgyNTI=","url":"https://api.github.com/repos/palantir/tslint/labels/Status:%20In%20Discussion","name":"Status: In Discussion","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":{"login":"adidahiya","id":723999,"node_id":"MDQ6VXNlcjcyMzk5OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/723999?v=4","gravatar_id":"","url":"https://api.github.com/users/adidahiya","html_url":"https://github.com/adidahiya","followers_url":"https://api.github.com/users/adidahiya/followers","following_url":"https://api.github.com/users/adidahiya/following{/other_user}","gists_url":"https://api.github.com/users/adidahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/adidahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidahiya/subscriptions","organizations_url":"https://api.github.com/users/adidahiya/orgs","repos_url":"https://api.github.com/users/adidahiya/repos","events_url":"https://api.github.com/users/adidahiya/events{/privacy}","received_events_url":"https://api.github.com/users/adidahiya/received_events","type":"User","site_admin":false},"assignees":[{"login":"adidahiya","id":723999,"node_id":"MDQ6VXNlcjcyMzk5OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/723999?v=4","gravatar_id":"","url":"https://api.github.com/users/adidahiya","html_url":"https://github.com/adidahiya","followers_url":"https://api.github.com/users/adidahiya/followers","following_url":"https://api.github.com/users/adidahiya/following{/other_user}","gists_url":"https://api.github.com/users/adidahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/adidahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidahiya/subscriptions","organizations_url":"https://api.github.com/users/adidahiya/orgs","repos_url":"https://api.github.com/users/adidahiya/repos","events_url":"https://api.github.com/users/adidahiya/events{/privacy}","received_events_url":"https://api.github.com/users/adidahiya/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2017-05-27T17:14:02Z","updated_at":"2018-07-31T18:13:36Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/palantir/tslint/pulls/2831","html_url":"https://github.com/palantir/tslint/pull/2831","diff_url":"https://github.com/palantir/tslint/pull/2831.diff","patch_url":"https://github.com/palantir/tslint/pull/2831.patch"},"body":"#### PR checklist\r\n\r\n- [ ] Addresses an existing issue: #0000\r\n- [x] New feature, bugfix, or enhancement\r\n  - [x] Includes tests\r\n- [x] Documentation update\r\n\r\n#### Overview of change:\r\nFixed a bug for numeric property types - the code was not checking `ts.SyntaxKind.NumericLiteral` for nodes.\r\n\r\nThe current rule didn't attempt to check object literals defined on a single-line, and this wasn't explicitly called out in the rule's description. Made this as a new option to keep backwards-compatibility vs just enabling it by default.\r\n\r\n~~Added the ability to check whether shorthand properties are evaluated in order.~~\r\nAdded the ability to choose how object keys are sorted by type.\r\nI originally used a rule from tslint-consistent-codestyle to require shorthand-properties first. The latest major update to tslint started conflicting with that rule. I really like keeping shorthand first since I think it helps reduce errors. I originally thought there could be two rules, but they would conflict to a degree. There could probably still be a shorthand-first rule for those not using sort-keys.\r\n\r\n#### CHANGELOG.md entry:\r\n[new-rule-option] `object-literal-sort-keys`: Add `check-single-line` option\r\n[new-rule-option] `object-literal-sort-keys`: Add option to provide order of key types. Possible values are `spread`, `shorthand`, and `longhand`\r\n[bugfix] `object-literal-sort-keys`: Properly compare numeric property names\r\n[enhancement] `object-literal-sort-keys`: Do not reset after encountering a spread attribute"},"comment":{"url":"https://api.github.com/repos/palantir/tslint/issues/comments/409317205","html_url":"https://github.com/palantir/tslint/pull/2831#issuecomment-409317205","issue_url":"https://api.github.com/repos/palantir/tslint/issues/2831","id":409317205,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTMxNzIwNQ==","user":{"login":"giladgray","id":464822,"node_id":"MDQ6VXNlcjQ2NDgyMg==","avatar_url":"https://avatars1.githubusercontent.com/u/464822?v=4","gravatar_id":"","url":"https://api.github.com/users/giladgray","html_url":"https://github.com/giladgray","followers_url":"https://api.github.com/users/giladgray/followers","following_url":"https://api.github.com/users/giladgray/following{/other_user}","gists_url":"https://api.github.com/users/giladgray/gists{/gist_id}","starred_url":"https://api.github.com/users/giladgray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giladgray/subscriptions","organizations_url":"https://api.github.com/users/giladgray/orgs","repos_url":"https://api.github.com/users/giladgray/repos","events_url":"https://api.github.com/users/giladgray/events{/privacy}","received_events_url":"https://api.github.com/users/giladgray/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T18:13:36Z","updated_at":"2018-07-31T18:13:36Z","author_association":"MEMBER","body":"@SteveByerly there are some great bug fixes in here so please continue, if you'd be so kind! but now you've got merge conflicts since this rule has been touched by others in the meantime, so check that out first. i'm happy to help."}}
{"actor":{"display_login":"giladgray"}}