{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/189","repository_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember","labels_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/189/comments","events_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/189/events","html_url":"https://github.com/ember-cli/eslint-plugin-ember/issues/189","id":276812900,"node_id":"MDU6SXNzdWUyNzY4MTI5MDA=","number":189,"title":"Error While Linting - new-module-imports","user":{"login":"Alonski","id":452199,"node_id":"MDQ6VXNlcjQ1MjE5OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/452199?v=4","gravatar_id":"","url":"https://api.github.com/users/Alonski","html_url":"https://github.com/Alonski","followers_url":"https://api.github.com/users/Alonski/followers","following_url":"https://api.github.com/users/Alonski/following{/other_user}","gists_url":"https://api.github.com/users/Alonski/gists{/gist_id}","starred_url":"https://api.github.com/users/Alonski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alonski/subscriptions","organizations_url":"https://api.github.com/users/Alonski/orgs","repos_url":"https://api.github.com/users/Alonski/repos","events_url":"https://api.github.com/users/Alonski/events{/privacy}","received_events_url":"https://api.github.com/users/Alonski/received_events","type":"User","site_admin":false},"labels":[{"id":509272522,"node_id":"MDU6TGFiZWw1MDkyNzI1MjI=","url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/labels/Bug","name":"Bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-26T09:59:07Z","updated_at":"2018-11-18T15:45:39Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hey friends,\r\nI just updated to \"^5.0.1\" from \"^4.6.1\"\r\n\r\n\r\nWhen linting I now get this error (causes Ember Build to also fail):\r\n```\r\n$ eslint app\r\nCannot read property 'forEach' of undefined\r\nTypeError: Cannot read property 'forEach' of undefined\r\n    at VariableDeclarator (D:\\Projects\\myApp\\node_modules\\eslint-plugin-ember\\lib\\rules\\new-module-imports.js:27:27)\r\n    at listeners.(anonymous function).forEach.listener (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\util\\safe-emitter.js:47:58)\r\n    at Array.forEach (native)\r\n    at Object.emit (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\util\\safe-emitter.js:47:38)\r\n    at NodeEventGenerator.applySelector (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\util\\node-event-generator.js:251:26)\r\n    at NodeEventGenerator.applySelectors (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\util\\node-event-generator.js:280:22)\r\n    at NodeEventGenerator.enterNode (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\util\\node-event-generator.js:294:14)\r\n    at CodePathAnalyzer.enterNode (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\code-path-analysis\\code-path-analyzer.js:608:23)\r\n    at Traverser.enter (D:\\Projects\\myApp\\node_modules\\eslint\\lib\\linter.js:956:32)\r\n    at Traverser.__execute (D:\\Projects\\myApp\\node_modules\\estraverse\\estraverse.js:397:31)\r\n    at Traverser.traverse (D:\\Projects\\myApp\\node_modules\\estraverse\\estraverse.js:501:28)\r\n```\r\n\r\nSeems to fail here:\r\n```js\r\nconst properties = node.id.properties;\r\n        // Iterate through the destructured properties and report them\r\n        properties.forEach((item) => {\r\n```\r\nproperties is undefined\r\n\r\nIt might be a problem checking the rule on this file:\r\n```js\r\nimport Ember from \"ember\";\r\nimport { WebMethod } from \"camilyo/utils/web-method\";\r\nimport { sUrlShortener } from \"camilyo/utils/constants\";\r\nconst $ = Ember;\r\nconst { get, set } = Ember;\r\n/* globals common, goModalHandler */\r\n\r\nexport default Ember.Controller.extend({\r\n    queryParams: [{ isBlast: \"b\" }],\r\n    ec: \"\",\r\n    recentLinks: [],\r\n    senderTitle: \"\",\r\n    isBlast: false,\r\n    smsCampaignWizard: Ember.inject.controller(\"sms\"),\r\n    canAddTemplate: Ember.computed(\"user\", function() {\r\n        return user.checkPerm(\"show_sms_templates_manager\");\r\n    }),\r\n    socialPagesF: Ember.computed(\"user\", function() {\r\n        if (get(this.user, \"socialPages\") && get(this.user, \"socialPages\").facebookPages.length > 0) {\r\n            return true;\r\n        }\r\n        return false;\r\n    }),\r\n    socialPagesT: Ember.computed(\"user\", function() {\r\n        if (get(this.user, \"socialPages\") && get(this.user, \"socialPages\").twitterPages.length > 0) {\r\n            return true;\r\n        }\r\n        return false;\r\n    }),\r\n    recentLinksDisplay: Ember.computed(\"recentLinks\", \"recentLinks.[]\", function() {\r\n        return get(this, \"recentLinks\")\r\n            .toArray()\r\n            .reverse();\r\n    }),\r\n    popups: Ember.Object.create({\r\n        shortlinkCreate: false,\r\n        shortlinkCreateButtons: []\r\n    }),\r\n    smsbodyText: \"\",\r\n    showShortLinksInnerTitle: Ember.computed(\"recentLinks\", \"recentLinks.[]\", function() {\r\n        if (get(this, \"recentLinks\") && get(this, \"recentLinks\").length > 0) {\r\n            return true;\r\n        }\r\n        return false;\r\n    }),\r\n    smsBodyTextDisplay: Ember.computed(\"ec.selectedTemplate.body\", \"smsbodyText\", {\r\n        set: function(key, value) {\r\n            set(this, \"smsbodyText\", value);\r\n        },\r\n        get: function() {\r\n            return get(this, \"smsbodyText\") ? get(this, \"smsbodyText\") : \"\";\r\n        }\r\n    }),\r\n    smsBodyTextDisplayHtm: Ember.computed(\"smsbodyText\", function() {\r\n        if (get(this, \"smsbodyText\")) {\r\n            return get(this, \"smsbodyText\").replace(/\\n/g, \"<br/>\");\r\n        } else {\r\n            return \"\";\r\n        }\r\n    }),\r\n    actions: {\r\n        linkEdit: function() {\r\n            set(this, \"popups.shortlinkCreate\", true);\r\n        },\r\n        copyShortLink: function(shortLink) {\r\n            set(this, \"smsbodyText\", get(this, \"smsbodyText\") + \" \" + shortLink);\r\n        },\r\n        shortlinkExit: function() {\r\n            set(this, \"popups.shortlinkCreate\", false);\r\n        },\r\n        submitLink: function() {\r\n            var that = this;\r\n            var url = $(\".shortLinkInput\")\r\n                .val()\r\n                .replace(\"https://\", \"\");\r\n\r\n            var wrapPrefix =\r\n                user.domain === \"test.com\"\r\n                    ? \"http://webhook.com\"\r\n                    : \"sgwebhook\" + user.domain;\r\n\r\n            var wrappedUrl =\r\n                wrapPrefix +\r\n                \"?smsShortLink=true&campaignGuid=\" +\r\n                get(that, \"smsCampaignWizard.campaignGuid\") +\r\n                \"&url=\" +\r\n                encodeURIComponent(url);\r\n\r\n            goModalHandler.showMsgBoxNoButtons({\r\n                msg: get(this, \"i18n\").t(\"in-progress-please-wait...\")\r\n            });\r\n            WebMethod(\r\n                sUrlShortener,\r\n                \"Home/ShorterURL\",\r\n                { longUrl: wrappedUrl, ts: new Date().getTime() },\r\n                function(data) {\r\n                    if (data && data.status === true) {\r\n                        goModalHandler.hideModal();\r\n                        var responce = data.url.ShortUrl;\r\n                        if (get(that, \"recentLinks\").length > 2) {\r\n                            get(that, \"recentLinks\").removeAt(0, 1);\r\n                        }\r\n                        get(that, \"recentLinks\").pushObject({\r\n                            orig: $(\".shortLinkInput\").val(),\r\n                            shortUrl: responce\r\n                        });\r\n                    }\r\n                },\r\n                function() {\r\n                    goModalHandler.hideModal();\r\n                    alert(\"Error\");\r\n                }\r\n            );\r\n        },\r\n        saveTemplate: function() {\r\n            var that = this;\r\n            var model = this.store.createRecord(\"sms\", {\r\n                userId: get(this, \"user.userId\"),\r\n                body: get(this, \"smsbodyText\"),\r\n                group: get(this, \"ec.selectedTemplate.group\")\r\n            });\r\n            model.save().then(function() {\r\n                goModalHandler.showMsgBox({\r\n                    msg: get(that, \"i18n\").t(\"template-has-been-saved-successfully\") + \".\",\r\n                    ok: get(that, \"i18n\").t(\"ok\")\r\n                });\r\n            });\r\n        }\r\n    }\r\n});\r\n```\r\n\r\nWhen I set the rule to Off in eslintrc I get another error with require-super-in-init\r\n\r\n```\r\n\"eslint\": \"v4.2.0\"\r\n\"ember-cli\": \"2.12.2\",\r\n\"ember-cli-eslint\": \"^4.2.2\",\r\n```"},"comment":{"url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/comments/439702387","html_url":"https://github.com/ember-cli/eslint-plugin-ember/issues/189#issuecomment-439702387","issue_url":"https://api.github.com/repos/ember-cli/eslint-plugin-ember/issues/189","id":439702387,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTcwMjM4Nw==","user":{"login":"rwwagner90","id":2640861,"node_id":"MDQ6VXNlcjI2NDA4NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/2640861?v=4","gravatar_id":"","url":"https://api.github.com/users/rwwagner90","html_url":"https://github.com/rwwagner90","followers_url":"https://api.github.com/users/rwwagner90/followers","following_url":"https://api.github.com/users/rwwagner90/following{/other_user}","gists_url":"https://api.github.com/users/rwwagner90/gists{/gist_id}","starred_url":"https://api.github.com/users/rwwagner90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwwagner90/subscriptions","organizations_url":"https://api.github.com/users/rwwagner90/orgs","repos_url":"https://api.github.com/users/rwwagner90/repos","events_url":"https://api.github.com/users/rwwagner90/events{/privacy}","received_events_url":"https://api.github.com/users/rwwagner90/received_events","type":"User","site_admin":false},"created_at":"2018-11-18T15:45:39Z","updated_at":"2018-11-18T15:45:39Z","author_association":"CONTRIBUTOR","body":"I'm getting `Cannot read property 'forEach' of undefined` as well now."}}
{"actor":{"display_login":"rwwagner90"}}