{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/4936","labels_url":"https://api.github.com/repos/eslint/eslint/issues/4936/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/4936/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/4936/events","html_url":"https://github.com/eslint/eslint/issues/4936","id":126420776,"number":4936,"title":"'strict' rule is only partially overridden by `sourceType: module`","user":{"login":"nre","id":11390066,"avatar_url":"https://avatars.githubusercontent.com/u/11390066?v=3","gravatar_id":"","url":"https://api.github.com/users/nre","html_url":"https://github.com/nre","followers_url":"https://api.github.com/users/nre/followers","following_url":"https://api.github.com/users/nre/following{/other_user}","gists_url":"https://api.github.com/users/nre/gists{/gist_id}","starred_url":"https://api.github.com/users/nre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nre/subscriptions","organizations_url":"https://api.github.com/users/nre/orgs","repos_url":"https://api.github.com/users/nre/repos","events_url":"https://api.github.com/users/nre/events{/privacy}","received_events_url":"https://api.github.com/users/nre/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/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-13T13:44:39Z","updated_at":"2016-01-13T22:23:58Z","closed_at":null,"body":"v2.0.0-beta.1\r\n\r\nThe documentation does not cover the behaviour of the 'strict' rule when strict mode is imposed by a parser option: `sourceType: module` (and, hopefully one day, `ecmaFeatures: impliedStrict` #4832).\r\n\r\nThe behaviour is also inconsistent. The 'strict' option 'none' incorrectly implies that strict mode can be somehow disabled inside ES6 modules ('Strict mode is not permitted'):\r\n\r\n```json\r\n{\r\n\t\"parserOptions\": {\r\n\t\t\"sourceType\": \"module\"\r\n\t}\r\n}\r\n```\r\n```js\r\n/* eslint strict: [2, \"never\"] */\r\n\"use strict\";\r\n```\r\n```\r\n  2:1  error  Strict mode is not permitted  strict\r\n\r\n✖ 1 problem (1 error, 0 warnings)\r\n```\r\n\r\nWhereas the 'strict' options 'global|function|safe' are overridden by the module configuration (\"'use strict' is unnecessary inside of modules\"):\r\n\r\n```json\r\n{\r\n\t\"parserOptions\": {\r\n\t\t\"sourceType\": \"module\"\r\n\t}\r\n}\r\n```\r\n```js\r\n/* eslint strict: [2, \"global\"] */\r\n\"use strict\";\r\n```\r\n```\r\n  2:1  error  'use strict' is unnecessary inside of modules  strict\r\n\r\n✖ 1 problem (1 error, 0 warnings)\r\n```\r\n\r\nI would like to make a PR that:\r\n- Has ES6 modules override all 'strict' rule options. (This is not a breaking change. Only the message will change.)\r\n- Documents the behaviour of the 'strict' rule and ES6 modules.\r\n- Clarifies the docs to say that the 'strict' rule polices strict-mode *directives* and not strict mode itself. (The 'strict' rule only looks for directives&mdash;it does not use the data in escope. It is a third independent implementation of the strict-directive algorithm, [in addition to the parser and escope](https://github.com/estools/escope/issues/92#issuecomment-168532171).)\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/29839448-strict-rule-is-only-partially-overridden-by-sourcetype-module?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/171456311","html_url":"https://github.com/eslint/eslint/issues/4936#issuecomment-171456311","issue_url":"https://api.github.com/repos/eslint/eslint/issues/4936","id":171456311,"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-01-13T22:23:58Z","updated_at":"2016-01-13T22:23:58Z","body":"Sounds good, let's do it."}}