{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5185","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5185/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5185/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5185/events","html_url":"https://github.com/eslint/eslint/issues/5185","id":132213641,"number":5185,"title":"Proposed new rule: only-template","user":{"login":"callumlocke","id":250617,"avatar_url":"https://avatars.githubusercontent.com/u/250617?v=3","gravatar_id":"","url":"https://api.github.com/users/callumlocke","html_url":"https://github.com/callumlocke","followers_url":"https://api.github.com/users/callumlocke/followers","following_url":"https://api.github.com/users/callumlocke/following{/other_user}","gists_url":"https://api.github.com/users/callumlocke/gists{/gist_id}","starred_url":"https://api.github.com/users/callumlocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumlocke/subscriptions","organizations_url":"https://api.github.com/users/callumlocke/orgs","repos_url":"https://api.github.com/users/callumlocke/repos","events_url":"https://api.github.com/users/callumlocke/events{/privacy}","received_events_url":"https://api.github.com/users/callumlocke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/feature","name":"feature","color":"bfd4f2"},{"url":"https://api.github.com/repos/eslint/eslint/labels/proposal","name":"proposal","color":"fef2c0"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-08T17:52:54Z","updated_at":"2016-02-08T21:13:27Z","closed_at":"2016-02-08T21:13:27Z","body":"**When does this rule warn? Please describe and show example code:**\r\n\r\nThe rule warns whenever you use a single- or double-quote as a string delimiter. That is, you have to use backticks for *every* string, even when you're not concatenating/interpolating a dynamic value into the string.\r\n\r\n```js\r\nabc('hi!'); // warning: prefer abc(`hi!`);\r\n\r\n// etc.\r\n```\r\n\r\nThe only exception would be for non-computed object key names, where backticks are not allowed, therefore single- or double-quotes are still necessary:\r\n\r\n```js\r\n{ 'some-prop': 123 } // no warning, because { `some-prop`: 123 } would be illegal\r\n```\r\n\r\nNB. this proposal is not the same as [prefer-template](http://eslint.org/docs/rules/prefer-template), which is about preferring template interpolation over concatenation. The proposed `only-template` rule is about preferring backticks for *every* string, even completely static ones.\r\n\r\n**Is this rule preventing an error or is it stylistic?**\r\n\r\nStylistic.\r\n\r\n**Why is this rule a candidate for inclusion instead of creating a custom rule?**\r\n\r\nReasons why someone might want to enable this rule:\r\n\r\n- One syntax for strings is enough. Anything that reduces the size of the subset of the language you allow yourself to use is usually a good thing.\r\n\r\n- Using backticks as your standard string delimeter is preferable even when you're not using the interpolation functionality, because it means you never have to escape literal quote marks (which occur as literal characters way more often than backticks or the `${` sequence).\r\n\r\n**Are you willing to create the rule yourself?**\r\n\r\nYes"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/181570045","html_url":"https://github.com/eslint/eslint/issues/5185#issuecomment-181570045","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5185","id":181570045,"user":{"login":"callumlocke","id":250617,"avatar_url":"https://avatars.githubusercontent.com/u/250617?v=3","gravatar_id":"","url":"https://api.github.com/users/callumlocke","html_url":"https://github.com/callumlocke","followers_url":"https://api.github.com/users/callumlocke/followers","following_url":"https://api.github.com/users/callumlocke/following{/other_user}","gists_url":"https://api.github.com/users/callumlocke/gists{/gist_id}","starred_url":"https://api.github.com/users/callumlocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumlocke/subscriptions","organizations_url":"https://api.github.com/users/callumlocke/orgs","repos_url":"https://api.github.com/users/callumlocke/repos","events_url":"https://api.github.com/users/callumlocke/events{/privacy}","received_events_url":"https://api.github.com/users/callumlocke/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T21:13:27Z","updated_at":"2016-02-08T21:13:27Z","body":"Awesome, I guess this can be closed then, thanks\r\n\r\n"}}