{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/6614","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/6614/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6614/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/6614/events","html_url":"https://github.com/eslint/eslint/issues/6614","id":164128134,"number":6614,"title":"Rule idea: no useless template literals","user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0"},{"url":"https://api.github.com/repos/eslint/eslint/labels/feature","name":"feature","color":"bfd4f2"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-06T17:15:55Z","updated_at":"2016-07-07T14:05:47Z","closed_at":null,"body":"**When does this rule warn? Please describe and show example code:**\r\n\r\n```javascript\r\n// These are bad:\r\nconst foo = `${otherVar}`;\r\nconst bar = `${someFn(1, 2, 3)}`;\r\n\r\n// They should be:\r\nconst foo = otherVar;\r\nconst bar = someFn(1, 2, 3);\r\n```\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\nI noticed this pattern a bunch in a recent code review. It can easily happen if you're modifying existing code that uses template literals and don't notice that your literals have become trivial.\r\n\r\n**Are you willing to create the rule yourself?**\r\n\r\nPossibly. (I've implemented tslint rules but never eslint rules.)\r\n"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/231087601","html_url":"https://github.com/eslint/eslint/issues/6614#issuecomment-231087601","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6614","id":231087601,"user":{"login":"alberto","id":72561,"avatar_url":"https://avatars.githubusercontent.com/u/72561?v=3","gravatar_id":"","url":"https://api.github.com/users/alberto","html_url":"https://github.com/alberto","followers_url":"https://api.github.com/users/alberto/followers","following_url":"https://api.github.com/users/alberto/following{/other_user}","gists_url":"https://api.github.com/users/alberto/gists{/gist_id}","starred_url":"https://api.github.com/users/alberto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alberto/subscriptions","organizations_url":"https://api.github.com/users/alberto/orgs","repos_url":"https://api.github.com/users/alberto/repos","events_url":"https://api.github.com/users/alberto/events{/privacy}","received_events_url":"https://api.github.com/users/alberto/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T14:05:47Z","updated_at":"2016-07-07T14:05:47Z","body":"As you mentioned they are not equivalent, since the template ensures you get a string."}}
{"actor":{"display_login":"alberto"}}