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

Fails with eslint 8.40.0: TypeError: Cannot read properties of undefined (reading 'getAllComments') #718

Closed
andersk opened this issue May 5, 2023 · 6 comments

Comments

@andersk
Copy link
Contributor

andersk commented May 5, 2023

Upgrading eslint from 8.39.0 to 8.40.0 (released an hour ago) causes xo to fail with this error.

pnpm test

> xo@0.54.2 test /home/anders/js/xo
> node cli.js && nyc ava

TypeError: Cannot read properties of undefined (reading 'getAllComments')
Occurred while linting /home/anders/js/xo/cli.js:3
Rule: "unicorn/expiring-todo-comments"
    at Object.Program (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/rules/no-warning-comments.js:193:45)
    at Program (/home/anders/js/xo/node_modules/.pnpm/eslint-plugin-unicorn@46.0.0_eslint@8.40.0/node_modules/eslint-plugin-unicorn/rules/expiring-todo-comments.js:514:10)
    at /home/anders/js/xo/node_modules/.pnpm/eslint-plugin-unicorn@46.0.0_eslint@8.40.0/node_modules/eslint-plugin-unicorn/rules/utils/rule.js:39:18
    at ruleErrorHandler (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/linter.js:1049:28)
    at /home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/home/anders/js/xo/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
 ELIFECYCLE  Test failed. See above for more details.
@dahiro
Copy link

dahiro commented May 8, 2023

Discussing it here eslint/eslint#17167
In the meantime I downgraded to 8.39.0 again

@ilarramendi
Copy link

I started experiencing this problem yesterday, downgrading xo to 0.53 didn't fix the issue
TypeError: Cannot read properties of undefined (reading 'getAllComments')
Occurred while linting C:\Users\ilarr\Documents\dev-tools\ns_npm_repository\bundler\index.ts:1

@larouxn
Copy link

larouxn commented Jun 7, 2023

Appears the issue is actually with an older version of eslint-plugin-unicorn.

Apparently upgrading that plugin resolves the issue re: eslint/eslint#17167 (comment).

We may be able to resolve this issue by upgrading eslint-plugin-unicorn in xo to 47.0.0.

"eslint-plugin-unicorn": "^46.0.0",

Opened a bump PR up over here.

@sindresorhus
Copy link
Member

The issue was fixed in eslint-plugin-unicorn 46.0.1 (not 47): https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v46.0.1

@larouxn
Copy link

larouxn commented Jun 7, 2023

The issue was fixed in eslint-plugin-unicorn 46.0.1 (not 47): https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v46.0.1

Alright, let's do a bump to 46.0.1.

@fregante
Copy link
Member

Closing.

Solution

  • update xo to at least v0.55.0
  • or update eslint-plugin-unicorn to at least v46.0.1

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

Successfully merging a pull request may close this issue.

6 participants