{"action":"created","comment":{"url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/comments/202604210","pull_request_review_id":137334613,"id":202604210,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjYwNDIxMA==","diff_hunk":"@@ -118,7 +128,26 @@ const checkColor = (node, context) => {\n       message: `Use the following Backpack token instead: ${\n         expectedToken.name\n       }`,\n-      fix: fixer => fixer.replaceText(value, expectedToken.name),\n+      fix: fixer => {\n+        const { options: userOptions } = context;\n+        const options = _.merge({}, BASE_CONFIG, userOptions[0] || {});\n+        const tokensPkg = options.tokensPackage[options.platform];\n+\n+        const importDefinition = getImportDefinition(","path":"src/rules/use-tokens.js","position":27,"original_position":27,"commit_id":"d26768845c818d27ddf36294bef173eb84118d42","original_commit_id":"d26768845c818d27ddf36294bef173eb84118d42","user":{"login":"k0nserv","id":1333960,"node_id":"MDQ6VXNlcjEzMzM5NjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1333960?v=4","gravatar_id":"","url":"https://api.github.com/users/k0nserv","html_url":"https://github.com/k0nserv","followers_url":"https://api.github.com/users/k0nserv/followers","following_url":"https://api.github.com/users/k0nserv/following{/other_user}","gists_url":"https://api.github.com/users/k0nserv/gists{/gist_id}","starred_url":"https://api.github.com/users/k0nserv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k0nserv/subscriptions","organizations_url":"https://api.github.com/users/k0nserv/orgs","repos_url":"https://api.github.com/users/k0nserv/repos","events_url":"https://api.github.com/users/k0nserv/events{/privacy}","received_events_url":"https://api.github.com/users/k0nserv/received_events","type":"User","site_admin":false},"body":"nitpic: We don't need to construct this value if we have `!options.autoImport`. ","created_at":"2018-07-16T08:28:04Z","updated_at":"2018-07-16T08:40:42Z","html_url":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9#discussion_r202604210","pull_request_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/comments/202604210"},"html":{"href":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9#discussion_r202604210"},"pull_request":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9","id":201061878,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMDYxODc4","html_url":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9","diff_url":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9.diff","patch_url":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9.patch","issue_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/9","number":9,"state":"open","locked":false,"title":"[BPK-1674] Move auto import logic to use-tokens rule","user":{"login":"tiagoengel","id":1457263,"node_id":"MDQ6VXNlcjE0NTcyNjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1457263?v=4","gravatar_id":"","url":"https://api.github.com/users/tiagoengel","html_url":"https://github.com/tiagoengel","followers_url":"https://api.github.com/users/tiagoengel/followers","following_url":"https://api.github.com/users/tiagoengel/following{/other_user}","gists_url":"https://api.github.com/users/tiagoengel/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagoengel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagoengel/subscriptions","organizations_url":"https://api.github.com/users/tiagoengel/orgs","repos_url":"https://api.github.com/users/tiagoengel/repos","events_url":"https://api.github.com/users/tiagoengel/events{/privacy}","received_events_url":"https://api.github.com/users/tiagoengel/received_events","type":"User","site_admin":false},"body":"This PR extracts the auto import logic to reusable functions and add it as part of the `use-tokens` rule. The plan is to apply the auto import logic in the `use-components` rule too.","created_at":"2018-07-12T16:44:19Z","updated_at":"2018-07-16T08:40:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f98c4f4461952a1fa86601bbffc8f1a01339e559","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/9/comments","statuses_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/statuses/d26768845c818d27ddf36294bef173eb84118d42","head":{"label":"Skyscanner:BPK-1674-merge-autoimport-and-usetokens","ref":"BPK-1674-merge-autoimport-and-usetokens","sha":"d26768845c818d27ddf36294bef173eb84118d42","user":{"login":"Skyscanner","id":522811,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyMjgxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/522811?v=4","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"repo":{"id":133682839,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM2ODI4Mzk=","name":"eslint-plugin-backpack","full_name":"Skyscanner/eslint-plugin-backpack","owner":{"login":"Skyscanner","id":522811,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyMjgxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/522811?v=4","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skyscanner/eslint-plugin-backpack","description":null,"fork":false,"url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack","forks_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/forks","keys_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/teams","hooks_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/hooks","issue_events_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/events{/number}","events_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/events","assignees_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/assignees{/user}","branches_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/branches{/branch}","tags_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/tags","blobs_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/languages","stargazers_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/stargazers","contributors_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/contributors","subscribers_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/subscribers","subscription_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/subscription","commits_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/contents/{+path}","compare_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/merges","archive_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/downloads","issues_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues{/number}","pulls_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/labels{/name}","releases_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/releases{/id}","deployments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/deployments","created_at":"2018-05-16T14:58:57Z","updated_at":"2018-07-13T12:28:08Z","pushed_at":"2018-07-13T15:07:27Z","git_url":"git://github.com/Skyscanner/eslint-plugin-backpack.git","ssh_url":"git@github.com:Skyscanner/eslint-plugin-backpack.git","clone_url":"https://github.com/Skyscanner/eslint-plugin-backpack.git","svn_url":"https://github.com/Skyscanner/eslint-plugin-backpack","homepage":null,"size":80,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Skyscanner:master","ref":"master","sha":"9c03b1fa7b3beed6e690f6671ef8371ab10118de","user":{"login":"Skyscanner","id":522811,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyMjgxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/522811?v=4","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"repo":{"id":133682839,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM2ODI4Mzk=","name":"eslint-plugin-backpack","full_name":"Skyscanner/eslint-plugin-backpack","owner":{"login":"Skyscanner","id":522811,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyMjgxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/522811?v=4","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skyscanner/eslint-plugin-backpack","description":null,"fork":false,"url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack","forks_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/forks","keys_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/teams","hooks_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/hooks","issue_events_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/events{/number}","events_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/events","assignees_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/assignees{/user}","branches_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/branches{/branch}","tags_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/tags","blobs_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/statuses/{sha}","languages_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/languages","stargazers_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/stargazers","contributors_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/contributors","subscribers_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/subscribers","subscription_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/subscription","commits_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/contents/{+path}","compare_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/merges","archive_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/downloads","issues_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues{/number}","pulls_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls{/number}","milestones_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/milestones{/number}","notifications_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/labels{/name}","releases_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/releases{/id}","deployments_url":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/deployments","created_at":"2018-05-16T14:58:57Z","updated_at":"2018-07-13T12:28:08Z","pushed_at":"2018-07-13T15:07:27Z","git_url":"git://github.com/Skyscanner/eslint-plugin-backpack.git","ssh_url":"git@github.com:Skyscanner/eslint-plugin-backpack.git","clone_url":"https://github.com/Skyscanner/eslint-plugin-backpack.git","svn_url":"https://github.com/Skyscanner/eslint-plugin-backpack","homepage":null,"size":80,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9"},"html":{"href":"https://github.com/Skyscanner/eslint-plugin-backpack/pull/9"},"issue":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/9"},"comments":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Skyscanner/eslint-plugin-backpack/statuses/d26768845c818d27ddf36294bef173eb84118d42"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"k0nserv"}}