{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5485","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5485/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5485/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5485/events","html_url":"https://github.com/eslint/eslint/issues/5485","id":138742256,"number":5485,"title":"docs: no-delete-var docs should mention strict mode","user":{"login":"aparajita","id":22218,"avatar_url":"https://avatars.githubusercontent.com/u/22218?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajita","html_url":"https://github.com/aparajita","followers_url":"https://api.github.com/users/aparajita/followers","following_url":"https://api.github.com/users/aparajita/following{/other_user}","gists_url":"https://api.github.com/users/aparajita/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajita/subscriptions","organizations_url":"https://api.github.com/users/aparajita/orgs","repos_url":"https://api.github.com/users/aparajita/repos","events_url":"https://api.github.com/users/aparajita/events{/privacy}","received_events_url":"https://api.github.com/users/aparajita/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc"},{"url":"https://api.github.com/repos/eslint/eslint/labels/documentation","name":"documentation","color":"5319e7"},{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-06T01:32:50Z","updated_at":"2016-04-27T19:32:56Z","closed_at":null,"body":"**What version of ESLint are you using?**\r\n\r\n2.3.0\r\n\r\n**What configuration and parser (Espree, Babel-ESLint, etc.) are you using?**\r\n\r\nN/A\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\n\r\nTried the example used in the no-delete-var docs.\r\n\r\n**What did you expect to happen?**\r\n\r\nI expected the no-delete-var error.\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\n\r\n`641:1  error  Parsing error: Deleting local variable in strict mode`\r\n\r\nThe no-delete-var docs should mention that this rule is only effective when in non-strict mode."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/215203253","html_url":"https://github.com/eslint/eslint/issues/5485#issuecomment-215203253","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5485","id":215203253,"user":{"login":"pedrottimark","id":11862657,"avatar_url":"https://avatars.githubusercontent.com/u/11862657?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrottimark","html_url":"https://github.com/pedrottimark","followers_url":"https://api.github.com/users/pedrottimark/followers","following_url":"https://api.github.com/users/pedrottimark/following{/other_user}","gists_url":"https://api.github.com/users/pedrottimark/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrottimark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrottimark/subscriptions","organizations_url":"https://api.github.com/users/pedrottimark/orgs","repos_url":"https://api.github.com/users/pedrottimark/repos","events_url":"https://api.github.com/users/pedrottimark/events{/privacy}","received_events_url":"https://api.github.com/users/pedrottimark/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T19:32:56Z","updated_at":"2016-04-27T19:32:56Z","body":"@aparajita Although it has taken a while for us to think this through, can you please give feedback about possibilities below to improve no-delete-var and no-dupe-args. These improvements will become a pattern we can apply to other rules which have similar issues. Specifically:\r\n\r\n* Do you prefer **A1** or **A2** or some other grammar or formatting for **When Not To Use It**\r\n* Do you think only some rules (for example, no-dupe-args) **B1** need to deal with this in the introduction (between the main heading and Rule Details) or all rules (including no-delete-var) **B2** And any critique of the grammar is welcome.\r\n\r\n**A1**. A minimal solution is a level-2 heading following Rule Details (or Options, if a rule has them)\r\n\r\n**When Not To Use It**\r\n\r\nYou do not need to enable this rule if ESLint parses code in strict mode, because it reports uses of the `delete` operator on variables as parsing errors.\r\n\r\n**A2**. A stronger solution (pardon the pun :) is to use bold font formatting:\r\n\r\n**When Not To Use It**\r\n\r\nYou do not need to enable this rule if ESLint parses code in **strict mode**, because it reports uses of the `delete` operator on variables as **parsing errors**.\r\n\r\n**B1**. Switching to no-dupe-args, there are 2 questions (in my mind, at least) when it is relevant:\r\n\r\nIf more than one parameter has the same name in a function definition, the last occurrence \"shadows\" the preceding occurrences. A duplicated name might be a typing error.\r\n\r\nJavaScript engines report duplicate parameter names as parsing errors:\r\n\r\n* in strict mode for function declarations or expressions (therefore, this rule is unnecessary)\r\n* always for arrow functions or class methods (this rule does not apply)\r\n\r\n**B2**. So the biggest question in my mind is whether the introduction to no-delete-var requires an additional sentence as illustrated below?\r\n\r\nThe purpose of the `delete` operator is to remove a property from an object. Using the `delete` operator on a variable might lead to unexpected behavior. [WE WILL REWRITE second sentence to be clearer]\r\n\r\nJavaScript engines report uses of the `delete` operator on variables as parsing errors."}}