v4.14.0 scope analysis issue with babel-eslint
See original GitHub issueFor some reason, after update:
ERROR Failed to compile with 1 errors 00:04:50
error in ./pages/_document.js?entry
Module build failed: TypeError: Cannot read property 'type' of undefined
at isForInRef (/Users/steida/dev/este/node_modules/eslint/lib/rules/no-unused-vars.js:410:24)
at variable.references.some.ref (/Users/steida/dev/este/node_modules/eslint/lib/rules/no-unused-vars.js:447:21)
at Array.some (<anonymous>)
at isUsedVariable (/Users/steida/dev/este/node_modules/eslint/lib/rules/no-unused-vars.js:446:40)
at collectUnusedVariables (/Users/steida/dev/este/node_modules/eslint/lib/rules/no-unused-vars.js:569:26)
at Program:exit (/Users/steida/dev/este/node_modules/eslint/lib/rules/no-unused-vars.js:621:36)
at listeners.(anonymous function).forEach.listener (/Users/steida/dev/este/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (/Users/steida/dev/este/node_modules/eslint/lib/util/safe-emitter.js:47:38)
at NodeEventGenerator.applySelector (/Users/steida/dev/este/node_modules/eslint/lib/util/node-event-generator.js:251:26)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:20 (8 by maintainers)
Top Results From Across the Web
Incompatibility with eslint 4.14.0 · Issue #558 - GitHub
Actually, it seems like the monkeypatched escope.analyze will never be called by parse-with-scope , because parse-with-scope creates a ...
Read more >ESLint - Error: Must use import to load ES Module
I think the problem is that you are trying to use the deprecated babel-eslint parser, last updated a year ago, which looks like...
Read more >Working with Custom Parsers - Pluggable JavaScript Linter
Custom parsers can use customized scope analysis for experimental/enhancement syntaxes. Default is the ScopeManager object which is created by eslint-scope.
Read more >@babel/eslint-parser - npm
ESLint parser that allows for linting of experimental syntax transformed by Babel. Latest version: 7.19.1, last published: 3 months ago.
Read more >babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. The latest ECMAScript version enabled by default (ES2020). Comment attachment.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@not-an-aardvark I tried babel-eslint
8.1.0
and was still experiencing the issue.I’ve downgraded to eslint
4.13.0
for now.Opened a
babel-eslint
ticket here: https://github.com/babel/babel-eslint/issues/558@not-an-aardvark I’ll put the work on that team to update dependencies citing this task. May come back later. Thanks for quick response.