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

Fix: Add additional conditions in no-unused-vars.js rules. #13592

Closed
wants to merge 1 commit into from
Closed

Fix: Add additional conditions in no-unused-vars.js rules. #13592

wants to merge 1 commit into from

Conversation

limpid-kzonix
Copy link

@limpid-kzonix limpid-kzonix commented Aug 19, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:

TypeError: Cannot read property 'type' of undefined
Occurred while linting /octoman/octo/pulls/core.mjs:3

TypeError: Cannot read property 'type' of undefined
Occurred while linting /octoman/octo/pulls/core.mjs:3
    at isForInRef (/node_modules/eslint/lib/rules/no-unused-vars.js:449:24)
    at /home/limpid/KzonixProjects/octoman/node_modules/eslint/lib/rules/no-unused-vars.js:486:21
    at Array.some (<anonymous>)
    at isUsedVariable (/node_modules/eslint/lib/rules/no-unused-vars.js:485:40)
    at collectUnusedVariables (/node_modules/eslint/lib/rules/no-unused-vars.js:596:26)
    at Program:exit (/node_modules/eslint/lib/rules/no-unused-vars.js:615:36)
    at /node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
/** @format */

import moment            from 'moment'  // <<< TypeError: Cannot read property 'type' of undefined. Occurred while linting /octoman/octo/pulls/core.mjs:3
import { OctomanLogger } from '../../logger.mjs'
import { octokit }       from '../core.mjs'
...

What changes did you make? (Give an overview)

Fix issue with unexpected error of es-module import

Is there anything you'd like reviewers to focus on?

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Aug 19, 2020
@mdjermanovic mdjermanovic added 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Aug 19, 2020
@mdjermanovic
Copy link
Member

Thanks for the PR!

I believe this is the same problem as #13575. From the error message this indeed looks like a problem in import, but it's probably crashing on private methods.

Is there a private method later in the code?

If that's the case, and as you already noted in #13589 (comment), this is a problem in babel parser.

babel/babel#11973 fix is already merged, we're waiting for Babel 7.11.4 to verify.

@limpid-kzonix
Copy link
Author

@mdjermanovic
Yes, there are private methods in the code.
It seems that these developments are not relevant, coz it must be corrected with the fix in babel-parser.
So, I think this PR could be closed

@mdjermanovic
Copy link
Member

@babel/eslint-parser v7.11.4 is released, can you try with this new version? Looks like the problem from #13575 is fixed.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 16, 2021
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants