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

Bug: Cannot read properties of undefined (reading 'getAllComments') #17224

Closed
1 task
pakkographic opened this issue May 26, 2023 · 2 comments
Closed
1 task
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed

Comments

@pakkographic
Copy link

pakkographic commented May 26, 2023

Environment

Node version: v19.4.0
npm version: 9.6.4
Local ESLint version: 8.41.0
Global ESLint version: 8.41.0
Operating System: macOS

What parser are you using?

@typescript-eslint/parser

What did you do?

Since 8.40.0, I get this error:

Oops! Something went wrong! :(

ESLint: 8.41.0

TypeError: Cannot read properties of undefined (reading 'getAllComments')
Occurred while linting /Users/wade/Documents/GitHub/touchguild/lib/Constants.ts:1
Rule: "unicorn/expiring-todo-comments"
    at Object.Program (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/rules/no-warning-comments.js:193:45)
    at Program (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint-plugin-unicorn/rules/expiring-todo-comments.js:511:10)
    at /Users/wade/Documents/GitHub/touchguild/node_modules/eslint-plugin-unicorn/rules/utils/rule.js:39:18
    at ruleErrorHandler (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/linter.js:1050:28)
    at /Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/Users/wade/Documents/GitHub/touchguild/node_modules/eslint/lib/linter/node-event-generator.js:340:14)

The Constants file, where I get the error (as you can see in the logs):

export const RESTMethods = [
    "GET",
    "POST",
    "PUT",
    "PATCH",
    "DELETE"
] as const;
export type RESTMethod = typeof RESTMethods[number];

export type UserTypes = "bot" | "user";

export * from "guildedapi-types.ts/v1"; // marks api typings as non-external (for docs).

export type ChannelReactionTypes = "ChannelMessage" | "ForumThread" | "CalendarEvent" | "Doc" | "ChannelAnnouncement";
export type ChannelSubcategoryReactionTypes = "CalendarEventComment" | "ForumThreadComment" | "DocComment" | "AnnouncementComment";

/** Channel reaction types that supports bulk delete.  */
export type ChannelReactionTypeBulkDeleteSupported = "ChannelMessage";

What did you expect to happen?

To work, like 8.39.0.

What actually happened?

Crashes, errors, for some specific reason that I'm probably not able to fix.

Link to Minimal Reproducible Example

there is no need for that. (if needed, check repository of library i'm developing that has the issue: "touchguild" on github)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@pakkographic pakkographic added bug ESLint is working incorrectly repro:needed labels May 26, 2023
@pakkographic pakkographic changed the title Bug: Bug: Cannot read properties of undefined (reading 'getAllComments' May 26, 2023
@pakkographic pakkographic changed the title Bug: Cannot read properties of undefined (reading 'getAllComments' Bug: Cannot read properties of undefined (reading 'getAllComments') May 26, 2023
@intellix
Copy link

thanks for sharing how you fixed it

@pakkographic
Copy link
Author

thanks for sharing how you fixed it

#17167 (comment)

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Nov 23, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly repro:needed
Projects
Archived in project
Development

No branches or pull requests

2 participants