{"action":"created","comment":{"url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/comments/348475566","pull_request_review_id":319831878,"id":348475566,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0ODQ3NTU2Ng==","diff_hunk":"@@ -213,12 +214,22 @@ function getSourceModuleNameForIdentifier(context, node) {\n   const importDeclaration = program.body\n     .filter(isImportDeclaration)\n     .find(importDeclaration =>\n-      importDeclaration.specifiers.some(specifier => specifier.local.name === node.name)\n+      importDeclaration.specifiers.some(\n+        specifier => specifier.local.name === getSourceModuleName(node)\n+      )\n     );\n \n   return importDeclaration ? importDeclaration.source.value : undefined;\n }\n \n+function getSourceModuleName(node) {\n+  if (isMemberExpression(node) && node.object) {\n+    return getSourceModuleName(node.object);\n+  }","path":"lib/utils/utils.js","position":24,"original_position":24,"commit_id":"012549d55197a94ab3a8cfd04e4c03f457cb8bab","original_commit_id":"012549d55197a94ab3a8cfd04e4c03f457cb8bab","user":{"login":"bmish","id":698306,"node_id":"MDQ6VXNlcjY5ODMwNg==","avatar_url":"https://avatars3.githubusercontent.com/u/698306?v=4","gravatar_id":"","url":"https://api.github.com/users/bmish","html_url":"https://github.com/bmish","followers_url":"https://api.github.com/users/bmish/followers","following_url":"https://api.github.com/users/bmish/following{/other_user}","gists_url":"https://api.github.com/users/bmish/gists{/gist_id}","starred_url":"https://api.github.com/users/bmish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmish/subscriptions","organizations_url":"https://api.github.com/users/bmish/orgs","repos_url":"https://api.github.com/users/bmish/repos","events_url":"https://api.github.com/users/bmish/events{/privacy}","received_events_url":"https://api.github.com/users/bmish/received_events","type":"User","site_admin":false},"body":"Can you change this to:\r\n```\r\n} else if (isIdentifier(node)) {\r\n  return node.name;\r\n} else {\r\n  assert(false, 'Function should only be called on `MemberExpression` or `Identifier`');\r\n}\r\n```\r\nThis will ensure the function is called on the right type of nodes (and make it clear what kind it can be used for).","created_at":"2019-11-20T13:19:21Z","updated_at":"2019-11-20T13:20:43Z","html_url":"https://github.com/ember-cli/eslint-plugin-ember/pull/592#discussion_r348475566","pull_request_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/comments/348475566"},"html":{"href":"https://github.com/ember-cli/eslint-plugin-ember/pull/592#discussion_r348475566"},"pull_request":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592"}}},"pull_request":{"url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592","id":339883615,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM5ODgzNjE1","html_url":"https://github.com/ember-cli/eslint-plugin-ember/pull/592","diff_url":"https://github.com/ember-cli/eslint-plugin-ember/pull/592.diff","patch_url":"https://github.com/ember-cli/eslint-plugin-ember/pull/592.patch","issue_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/592","number":592,"state":"open","locked":false,"title":"Update `no-classic-classes` rule to catch classic Ember Data model classes","user":{"login":"patocallaghan","id":685034,"node_id":"MDQ6VXNlcjY4NTAzNA==","avatar_url":"https://avatars2.githubusercontent.com/u/685034?v=4","gravatar_id":"","url":"https://api.github.com/users/patocallaghan","html_url":"https://github.com/patocallaghan","followers_url":"https://api.github.com/users/patocallaghan/followers","following_url":"https://api.github.com/users/patocallaghan/following{/other_user}","gists_url":"https://api.github.com/users/patocallaghan/gists{/gist_id}","starred_url":"https://api.github.com/users/patocallaghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patocallaghan/subscriptions","organizations_url":"https://api.github.com/users/patocallaghan/orgs","repos_url":"https://api.github.com/users/patocallaghan/repos","events_url":"https://api.github.com/users/patocallaghan/events{/privacy}","received_events_url":"https://api.github.com/users/patocallaghan/received_events","type":"User","site_admin":false},"body":"Currently `no-classic-classes` doesn't warn if you are using classic class syntax for Ember Data models.\r\n\r\nExamples of code it's failing to pick up are:\r\n\r\n``` js\r\nimport DS from 'ember-data';\r\nexport default DS.Model.extend({});\r\n```\r\n\r\n``` js\r\nimport Model from '@ember-data/model';\r\nexport default Model.extend({});\r\n```\r\n\r\nThis change results in the rule correctly throwing errors","created_at":"2019-11-12T12:26:06Z","updated_at":"2019-11-20T13:20:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eafbf67b9c51e9ec32b3d048c516b9911c492ddc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":611568048,"node_id":"MDU6TGFiZWw2MTE1NjgwNDg=","url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/labels/Enhancement","name":"Enhancement","color":"0e8a16","default":false,"description":null}],"milestone":null,"commits_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592/commits","review_comments_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592/comments","review_comment_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/592/comments","statuses_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/statuses/012549d55197a94ab3a8cfd04e4c03f457cb8bab","head":{"label":"patocallaghan:patoc/model-native-class","ref":"patoc/model-native-class","sha":"012549d55197a94ab3a8cfd04e4c03f457cb8bab","user":{"login":"patocallaghan","id":685034,"node_id":"MDQ6VXNlcjY4NTAzNA==","avatar_url":"https://avatars2.githubusercontent.com/u/685034?v=4","gravatar_id":"","url":"https://api.github.com/users/patocallaghan","html_url":"https://github.com/patocallaghan","followers_url":"https://api.github.com/users/patocallaghan/followers","following_url":"https://api.github.com/users/patocallaghan/following{/other_user}","gists_url":"https://api.github.com/users/patocallaghan/gists{/gist_id}","starred_url":"https://api.github.com/users/patocallaghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patocallaghan/subscriptions","organizations_url":"https://api.github.com/users/patocallaghan/orgs","repos_url":"https://api.github.com/users/patocallaghan/repos","events_url":"https://api.github.com/users/patocallaghan/events{/privacy}","received_events_url":"https://api.github.com/users/patocallaghan/received_events","type":"User","site_admin":false},"repo":{"id":216263817,"node_id":"MDEwOlJlcG9zaXRvcnkyMTYyNjM4MTc=","name":"eslint-plugin-ember","full_name":"patocallaghan/eslint-plugin-ember","private":false,"owner":{"login":"patocallaghan","id":685034,"node_id":"MDQ6VXNlcjY4NTAzNA==","avatar_url":"https://avatars2.githubusercontent.com/u/685034?v=4","gravatar_id":"","url":"https://api.github.com/users/patocallaghan","html_url":"https://github.com/patocallaghan","followers_url":"https://api.github.com/users/patocallaghan/followers","following_url":"https://api.github.com/users/patocallaghan/following{/other_user}","gists_url":"https://api.github.com/users/patocallaghan/gists{/gist_id}","starred_url":"https://api.github.com/users/patocallaghan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patocallaghan/subscriptions","organizations_url":"https://api.github.com/users/patocallaghan/orgs","repos_url":"https://api.github.com/users/patocallaghan/repos","events_url":"https://api.github.com/users/patocallaghan/events{/privacy}","received_events_url":"https://api.github.com/users/patocallaghan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/patocallaghan/eslint-plugin-ember","description":"An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices.","fork":true,"url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember","forks_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/forks","keys_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/teams","hooks_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/hooks","issue_events_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/issues/events{/number}","events_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/events","assignees_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/assignees{/user}","branches_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/branches{/branch}","tags_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/tags","blobs_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/languages","stargazers_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/stargazers","contributors_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/contributors","subscribers_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/subscribers","subscription_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/subscription","commits_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/contents/{+path}","compare_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/merges","archive_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/downloads","issues_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/issues{/number}","pulls_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/labels{/name}","releases_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/releases{/id}","deployments_url":"https://api.github.com/repos/patocallaghan/eslint-plugin-ember/deployments","created_at":"2019-10-19T20:06:02Z","updated_at":"2019-10-30T08:33:52Z","pushed_at":"2019-11-20T08:41:31Z","git_url":"git://github.com/patocallaghan/eslint-plugin-ember.git","ssh_url":"git@github.com:patocallaghan/eslint-plugin-ember.git","clone_url":"https://github.com/patocallaghan/eslint-plugin-ember.git","svn_url":"https://github.com/patocallaghan/eslint-plugin-ember","homepage":"","size":1849,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ember-cli:master","ref":"master","sha":"9274d2c83d5f013cf01d43e7740926996c88236b","user":{"login":"ember-cli","id":10262982,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjYyOTgy","avatar_url":"https://avatars3.githubusercontent.com/u/10262982?v=4","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":75928556,"node_id":"MDEwOlJlcG9zaXRvcnk3NTkyODU1Ng==","name":"eslint-plugin-ember","full_name":"ember-cli/eslint-plugin-ember","private":false,"owner":{"login":"ember-cli","id":10262982,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMjYyOTgy","avatar_url":"https://avatars3.githubusercontent.com/u/10262982?v=4","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ember-cli/eslint-plugin-ember","description":"An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices.","fork":false,"url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember","forks_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/forks","keys_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/teams","hooks_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/hooks","issue_events_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/events{/number}","events_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/events","assignees_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/assignees{/user}","branches_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/branches{/branch}","tags_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/tags","blobs_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/git/refs{/sha}","trees_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/statuses/{sha}","languages_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/languages","stargazers_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/stargazers","contributors_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/contributors","subscribers_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/subscribers","subscription_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/subscription","commits_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/commits{/sha}","git_commits_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/git/commits{/sha}","comments_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/comments{/number}","issue_comment_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/comments{/number}","contents_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/contents/{+path}","compare_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/merges","archive_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/downloads","issues_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues{/number}","pulls_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls{/number}","milestones_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/milestones{/number}","notifications_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/labels{/name}","releases_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/releases{/id}","deployments_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/deployments","created_at":"2016-12-08T10:40:40Z","updated_at":"2019-11-20T03:17:05Z","pushed_at":"2019-11-20T08:41:33Z","git_url":"git://github.com/ember-cli/eslint-plugin-ember.git","ssh_url":"git@github.com:ember-cli/eslint-plugin-ember.git","clone_url":"https://github.com/ember-cli/eslint-plugin-ember.git","svn_url":"https://github.com/ember-cli/eslint-plugin-ember","homepage":"","size":1939,"stargazers_count":224,"watchers_count":224,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":137,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":84,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":137,"open_issues":84,"watchers":224,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592"},"html":{"href":"https://github.com/ember-cli/eslint-plugin-ember/pull/592"},"issue":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/592"},"comments":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/592/comments"},"review_comments":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592/comments"},"review_comment":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/pulls/592/commits"},"statuses":{"href":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/statuses/012549d55197a94ab3a8cfd04e4c03f457cb8bab"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bmish"}}