question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error While Linting - new-module-imports

See original GitHub issue

Hey friends, I just updated to “^5.0.1” from “^4.6.1”

When linting I now get this error (causes Ember Build to also fail):

$ eslint app
Cannot read property 'forEach' of undefined
TypeError: Cannot read property 'forEach' of undefined
    at VariableDeclarator (D:\Projects\myApp\node_modules\eslint-plugin-ember\lib\rules\new-module-imports.js:27:27)
    at listeners.(anonymous function).forEach.listener (D:\Projects\myApp\node_modules\eslint\lib\util\safe-emitter.js:47:58)
    at Array.forEach (native)
    at Object.emit (D:\Projects\myApp\node_modules\eslint\lib\util\safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (D:\Projects\myApp\node_modules\eslint\lib\util\node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (D:\Projects\myApp\node_modules\eslint\lib\util\node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (D:\Projects\myApp\node_modules\eslint\lib\util\node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (D:\Projects\myApp\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:608:23)
    at Traverser.enter (D:\Projects\myApp\node_modules\eslint\lib\linter.js:956:32)
    at Traverser.__execute (D:\Projects\myApp\node_modules\estraverse\estraverse.js:397:31)
    at Traverser.traverse (D:\Projects\myApp\node_modules\estraverse\estraverse.js:501:28)

Seems to fail here:

const properties = node.id.properties;
        // Iterate through the destructured properties and report them
        properties.forEach((item) => {

properties is undefined

When I set the rule to Off in eslintrc I get another error with require-super-in-init

"eslint": "v4.2.0"
"ember-cli": "2.12.2",
"ember-cli-eslint": "^4.2.2",

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rwwagner90commented, Nov 19, 2018

I think it was potentially caused by not ignoring the concat-stats-for directory. I’m not seeing the issue anymore. If it comes back, I will let you know.

0reactions
chbonsercommented, Jul 2, 2020

In case it is helpful to others… I was seeing this same error and stack trace but it was because I needed to add /electron-out/ to .eslintignore

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint error when trying to lint Angular templates
I'm now trying to lint my component template files as well following this doc. Error while loading rule '@typescript-eslint/dot-notation': You ...
Read more >
Linting | Linkfire Frontend Guidelines
eslint is used for JavaScript linting: https://eslint.org/ ... 'ember/alias-model-in-controller': 'error', 'ember/new-module-imports': 'error', ...
Read more >
Use Lint code in Adobe Dreamweaver to detect errors
Learn how to lint HTML, CSS, and JS files in Adobe Dreamweaver. View the errors and warnings in the Output panel and jump...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
"error" or 2 - turn the rule on as an error (exit code is 1 when triggered). Using configuration comments. To configure rules...
Read more >
How to Automate Code Linting in Next.js with ESLint & Husky ...
Linting is the practice of checking code through automated static analysis for syntax errors and optionally code style issues. It typically ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found