{"action":"created","issue":{"url":"https://api.github.com/repos/uber/standard/issues/20","labels_url":"https://api.github.com/repos/uber/standard/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/uber/standard/issues/20/comments","events_url":"https://api.github.com/repos/uber/standard/issues/20/events","html_url":"https://github.com/uber/standard/pull/20","id":92500970,"number":20,"title":"Experimental ES6 Support","user":{"login":"malandrew","id":141789,"avatar_url":"https://avatars.githubusercontent.com/u/141789?v=3","gravatar_id":"","url":"https://api.github.com/users/malandrew","html_url":"https://github.com/malandrew","followers_url":"https://api.github.com/users/malandrew/followers","following_url":"https://api.github.com/users/malandrew/following{/other_user}","gists_url":"https://api.github.com/users/malandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/malandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malandrew/subscriptions","organizations_url":"https://api.github.com/users/malandrew/orgs","repos_url":"https://api.github.com/users/malandrew/repos","events_url":"https://api.github.com/users/malandrew/events{/privacy}","received_events_url":"https://api.github.com/users/malandrew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-01T22:43:39Z","updated_at":"2015-07-01T23:48:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/uber/standard/pulls/20","html_url":"https://github.com/uber/standard/pull/20","diff_url":"https://github.com/uber/standard/pull/20.diff","patch_url":"https://github.com/uber/standard/pull/20.patch"},"body":"This diff adds experimental ES6 support. \r\n\r\nSince ES6 is for all intents and purposes a different language, is experimental and has not yet been supported yet at uber until now, es6 mode will be used as a testing ground for trying out rules that may be backported into es5 mode if they provide utility in removing footguns and making code more consistent.\r\n\r\ni.e. if you want greater rule stability, choose es5 mode. If you're open to try out ES6, you're also opting in to being tolerant of trying out new rules to see if they provide greater code consistency between teams.\r\n\r\nIn an effort to ship ES6 mode to those who have been waiting, this PR will remain open for 24 hours after the first LGTM. Please look over the proposed rules and raise concerns now.\r\n\r\nThe rules specific to ES6 that I am curious to get people's opinion on are:\r\n - `object-shorthand` mode - There are cases where it makes things more readable and cases where it makes things less readable.\r\n - `accessor-pairs` mode - I didn't turn this one are, but should we? This one has configuration options.\r\n\r\nRules specific to ES6 mode are:\r\n- `no-var` (what's the point in having `let` and `const` if you aren't going to use them over `var`)\r\n- `prefer-const`\r\n- `generator-star-spacing`\r\n- `accessor-pairs`\r\n- `constructor-super`\r\n- `no-this-before-super`\r\n\r\nRules that are likely candidates to be ported to ES5 mode for the next major release are:\r\n- `no-catch-shadow` (probably a noop since there was already a no-shadow rule)\r\n- `no-continue`\r\n- `no-div-regex`\r\n- `no-else-return`\r\n- `no-eq-null` (probably a noop since we already enforce strict equality)\r\n- `no-extra-parens`\r\n- `no-inline-comments` (was already in lint-trap)\r\n- `no-mixed-requires` (probably a noop since we do one var per line)\r\n- `no-throw-literal` (long overdue, you should always generate an error object with a stack trace)\r\n- `no-unexpected-multiline`\r\n- `no-unneeded-ternary`\r\n- `array-bracket-spacing` (was already in lint trap)\r\n- `block-scoped-var`\r\n- `computed-property-spacing`\r\n- `dot-location`\r\n- `func-style` - this rule I am unsure about and want to try out because it seems like this isn't a 100% rule and it looks like it allows function expressions in many cases where you really only want a function expression (like assigning a function expression to a property on `this` in the constructor or assigning prototype props to function expressions). Because of this, I want to see how this actually works in practice. \r\n- `newline-after-var`\r\n- `object-curly-spacing` (was already in lint-trap)\r\n- `operator-linebreak`\r\n- `quote-props` - This one is turned on with the configuration \"as-needed\". I'm curious to get feedback on whether or not this is useful or problematic. Hard to tell without seeing how it actually works in the wild.\r\n- `sort-vars` - Given that we require one var per line, this one probably is a noop. However there is another rule, `one-var` which has an \"uninitialized\" and \"initialized\" option which is interesting that would make this rule relevant.\r\n- `space-before-function-paren` - this one should be a noop because I believe this is already enforced by some other rule we already have turned on. This was already rule in lint-trap.\r\n- `spaced-comment` - I need feedback from people on this one when it is used in practice. Most likely this is a useful rule, but will need to have the \"exceptions\" and \"markers\" options modified based on cases where it may not work.\r\n\r\nRules that remain turned off for both ES5 and ES6 mode:\r\n- `no-bitwise`\r\n- `no-nested-ternary`\r\n- `no-param-reassign`\r\n- `no-plusplus`\r\n- `no-reserved-keys`\r\n- `no-sync`\r\n- `no-ternary`\r\n- `no-undefined`\r\n- `no-void`\r\n- `lines-around-comment` - completely off, but I want others to look at whether some of the configurable options on this rule could be valuable.\r\n- `padded-blocks`\r\n- `vars-on-top`\r\n\r\nThe `no-restricted-modules` mode will be evaluated separately for both environments and will be added in in a separate pull request.\r\n\r\nAll the rules can be found here: https://github.com/eslint/eslint/tree/master/docs/rules\r\n\r\nFWIW, I want to eventually look into getting \"custom env\" support in eslint so that these can be moved to something you could turn on and off per file with an inline directive like: `/*eslint-env es6*/`, but for now you turn this on with the `--es6` command line flag.\r\n\r\ncc: @raynos @lxe @johnmegahan @rtsao @mlmorg @marthakelly @jcorbin @freeqaz @vicapow @philogb @superbeefy @mishabosin @addisonedwardlee @kenzanboo @collenjones @cain-uber @partriv @shaohua "},"comment":{"url":"https://api.github.com/repos/uber/standard/issues/comments/117854482","html_url":"https://github.com/uber/standard/pull/20#issuecomment-117854482","issue_url":"https://api.github.com/repos/uber/standard/issues/20","id":117854482,"user":{"login":"rtsao","id":780408,"avatar_url":"https://avatars.githubusercontent.com/u/780408?v=3","gravatar_id":"","url":"https://api.github.com/users/rtsao","html_url":"https://github.com/rtsao","followers_url":"https://api.github.com/users/rtsao/followers","following_url":"https://api.github.com/users/rtsao/following{/other_user}","gists_url":"https://api.github.com/users/rtsao/gists{/gist_id}","starred_url":"https://api.github.com/users/rtsao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtsao/subscriptions","organizations_url":"https://api.github.com/users/rtsao/orgs","repos_url":"https://api.github.com/users/rtsao/repos","events_url":"https://api.github.com/users/rtsao/events{/privacy}","received_events_url":"https://api.github.com/users/rtsao/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T23:48:18Z","updated_at":"2015-07-01T23:48:18Z","body":"It's not so bad with just two parameters, but I find using named object properties is more convenient because one doesn't have to remember parameter order.\r\n\r\nI'm not sure how I feel about heterogeneous object literals that mix shorthand and non-shorthand:\r\n\r\n```javascript\r\nvar obj = {\r\n  foo: 'abc',\r\n  bar: 4,\r\n  blah,\r\n  thing\r\n}\r\n```\r\n\r\nversus:\r\n```javascript\r\nvar obj = {\r\n  foo: 'abc',\r\n  bar: 4,\r\n  blah: blah,\r\n  thing: thing\r\n}\r\n```\r\n\r\nShould we force people into using the former by turning on the rule?"}}