Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-config-airbnb: error on component destructuring #2100

Closed
South-Paw opened this issue Sep 29, 2019 · 3 comments
Closed

eslint-config-airbnb: error on component destructuring #2100

South-Paw opened this issue Sep 29, 2019 · 3 comments

Comments

@South-Paw
Copy link

South-Paw commented Sep 29, 2019

Hi, hopefully I'm bringing this up in the right place.

I've got a project using eslint-config-airbnb (in the 3.0.0 branch) but I've started getting the following error which wasn't there earlier in the week.

TypeError: Cannot read property 'type' of undefined
Occurred while linting E:\dev\Github\react-vector-maps\src\VectorMap.js:4
    at checkDestructured (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\rules\no-useless-rename.js:104:43)
    at E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\node-event-generator.js:253:26)
    at NodeEventGenerator.applySelectors (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\node-event-generator.js:282:22)
    at NodeEventGenerator.enterNode (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\node-event-generator.js:296:14)
    at CodePathAnalyzer.enterNode (E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\code-path-analysis\code-path-analyzer.js:646:23)
    at E:\dev\Github\react-vector-maps\node_modules\eslint\lib\linter\linter.js:935:32
    at Array.forEach (<anonymous>)

The error occurs in any of the files with components as such and points to the destructing being the issue?

The issue occured on a CI build earlier and I reproduced it locally as well.

Removing the eslint-config-airbnb from the extends of the .eslintrc.js removes the error - hence why I thought I'd raise it here.

I fiddled with the project dependencies a bit but nothing seems to make a difference 😟

Any help would really be appreciated

@ljharb ljharb changed the title eslint-config-airbnb: error on component destructing eslint-config-airbnb: error on component destructuring Sep 29, 2019
@ljharb
Copy link
Collaborator

ljharb commented Sep 29, 2019

The stack trace says it’s an error with the eslint rule no-useless-rename; presumably if you enabled that rule even without extending airbnb it would still error.

What version of eslint are you using, and what’s your config look like?

@ljharb
Copy link
Collaborator

ljharb commented Sep 29, 2019

Looks like this is eslint/eslint#12335

@ljharb ljharb closed this as completed Sep 29, 2019
@South-Paw
Copy link
Author

@ljharb thanks for pointing me in the right direction - I'll keep track of that issue then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants