payload: {"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/12228","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/12228/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/12228/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/12228/events","html_url":"https://github.com/eslint/eslint/issues/12228","id":489988348,"node_id":"MDU6SXNzdWU0ODk5ODgzNDg=","number":12228,"title":"Add semi option to strengthen beforeStatementContinuationChars","user":{"login":"christianbundy","id":537700,"node_id":"MDQ6VXNlcjUzNzcwMA==","avatar_url":"https://avatars1.githubusercontent.com/u/537700?v=4","gravatar_id":"","url":"https://api.github.com/users/christianbundy","html_url":"https://github.com/christianbundy","followers_url":"https://api.github.com/users/christianbundy/followers","following_url":"https://api.github.com/users/christianbundy/following{/other_user}","gists_url":"https://api.github.com/users/christianbundy/gists{/gist_id}","starred_url":"https://api.github.com/users/christianbundy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianbundy/subscriptions","organizations_url":"https://api.github.com/users/christianbundy/orgs","repos_url":"https://api.github.com/users/christianbundy/repos","events_url":"https://api.github.com/users/christianbundy/events{/privacy}","received_events_url":"https://api.github.com/users/christianbundy/received_events","type":"User","site_admin":false},"labels":[{"id":45711352,"node_id":"MDU6TGFiZWw0NTcxMTM1Mg==","url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":45798639,"node_id":"MDU6TGFiZWw0NTc5ODYzOQ==","url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04","default":false},{"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":8,"created_at":"2019-09-05T20:36:01Z","updated_at":"2019-09-08T07:03:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--\r\n    ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).\r\n\r\n    This template is for requesting a rule change. If you are here for another reason, please see below:\r\n\r\n    1. To report a bug: https://eslint.org/docs/developer-guide/contributing/reporting-bugs\r\n    2. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules\r\n    3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes\r\n    4. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint\r\n\r\n    Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.\r\n-->\r\n\r\n**What rule do you want to change?**\r\n\r\n[semi](https://eslint.org/docs/rules/semi#options)\r\n\r\n**Does this change cause the rule to produce more or fewer warnings?**\r\n\r\nMore.\r\n\r\n**How will the change be implemented? (New option, new default behavior, etc.)?**\r\n\r\nNew option that disables the exception for `{ \"beforeStatementContinuationChars\": \"never\" }` that currently allows semicolons before statement continuation characters. Currently \"never\" implements behavior that I'd describe as \"never, if it doesn’t make ASI hazard\", whereas I'd really like to use \"never\" in general.\r\n\r\nMaybe something like \"allow ASI hazard\" or something? The default might be `{ \"allowAsiHazard\": true }` and the behavior I'm looking for would be `{ \"allowAsiHazard\": false }` or similar. I'm very open to suggestions on how to best implement this.\r\n\r\n**Please provide some example code that this change will affect:**\r\n\r\n<!-- Put your code examples here -->\r\n```js\r\n/*eslint semi: [\"error\", \"never\", { \"beforeStatementContinuationChars\": \"never\"}] */\r\n\r\nconsole.log(42)\r\n;(function() {\r\n    // ...\r\n})()\r\n```\r\n\r\n**What does the rule currently do for this code?**\r\n\r\nNo errors detected.\r\n\r\n**What will the rule do after it's changed?**\r\n\r\nDetect the error caused by the semicolon before the statement continuation characters.\r\n\r\n**Are you willing to submit a pull request to implement this change?**\r\n\r\nYes.\r\n\r\n---\r\n\r\nBacklink: https://github.com/standard/standard/issues/1402"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/529176253","html_url":"https://github.com/eslint/eslint/issues/12228#issuecomment-529176253","issue_url":"https://api.github.com/repos/eslint/eslint/issues/12228","id":529176253,"node_id":"MDEyOklzc3VlQ29tbWVudDUyOTE3NjI1Mw==","user":{"login":"mysticatea","id":1937871,"node_id":"MDQ6VXNlcjE5Mzc4NzE=","avatar_url":"https://avatars2.githubusercontent.com/u/1937871?v=4","gravatar_id":"","url":"https://api.github.com/users/mysticatea","html_url":"https://github.com/mysticatea","followers_url":"https://api.github.com/users/mysticatea/followers","following_url":"https://api.github.com/users/mysticatea/following{/other_user}","gists_url":"https://api.github.com/users/mysticatea/gists{/gist_id}","starred_url":"https://api.github.com/users/mysticatea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysticatea/subscriptions","organizations_url":"https://api.github.com/users/mysticatea/orgs","repos_url":"https://api.github.com/users/mysticatea/repos","events_url":"https://api.github.com/users/mysticatea/events{/privacy}","received_events_url":"https://api.github.com/users/mysticatea/received_events","type":"User","site_admin":false},"created_at":"2019-09-08T07:03:21Z","updated_at":"2019-09-08T07:03:21Z","author_association":"MEMBER","body":"No, the current behavior is intentional.\r\n\r\nThe `\"never\"` option reports *extra* semicolons because to prevent *extra* semicolons is the purpose of `semi` rule with `never` option. The rule doesn't consider the semicolons as *extra* if those protect code from ASI Hazard because it will change semantics if we delete the semicolons.\r\n\r\nAs #9594 said, the `beforeStatementContinuationChars` option considers the semicolons which satisfy the following conditions as *extra*:\r\n\r\n> - The semicolon (or lacking semicolon) is followed by the tokens which can make ASI hazard (`[`, `(`, `+`, `-`, or `` ` ``).\r\n> - But the semicolon (or lacking semicolon) does not make ASI hazard because the next token does not connect to the previous statement."}}
other: {"actor":{"display_login":"mysticatea"}}