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

unicorn/expiring-todo-comments fails with eslint 8.40.0 #2076

Closed
AlexAegis opened this issue May 5, 2023 · 3 comments · Fixed by #2077
Closed

unicorn/expiring-todo-comments fails with eslint 8.40.0 #2076

AlexAegis opened this issue May 5, 2023 · 3 comments · Fixed by #2077
Assignees

Comments

@AlexAegis
Copy link

AlexAegis commented May 5, 2023

Environment:

node: 20.1.0
pnpm: 8.4.0
eslint: 8.40.0
eslint-plugin-unicorn: 46.0.0

Running eslint gives me this error for unicorn/expiring-todo-comments:

TypeError: Cannot read properties of undefined (reading 'getAllComments')
Occurred while linting /home/alex/git/@aa/js-core/packages/common/.eslintrc.cjs:4
Rule: "unicorn/expiring-todo-comments"
    at Object.Program (/home/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/rules/no-warning-comments.js:193:45)
    at Program (/home/alex/git/@aa/js-core/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/alex/git/@aa/js-core/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/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/linter.js:1049:28)
    at /home/alex/git/@aa/js-core/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/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/home/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/home/alex/git/@aa/js-core/node_modules/.pnpm/eslint@8.40.0/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
 ELIFECYCLE  Command failed with exit code 2.

This is the last place the trace mentions: rules/no-warning-comments.js:193:45

image

If I turn this rule off, then eslint finishes just fine.

/** @type {import('eslint').Linter.Config} */
module.exports = {
	root: true,
	extends: ['@alexaegis/eslint-config-core'],
	rules: {
		'unicorn/expiring-todo-comments': 'off',
	},
};
@AlexAegis
Copy link
Author

AlexAegis commented May 5, 2023

Ironically that temporary rule override would be a perfect place to add an expiring todo to.

@seanblonien
Copy link

seanblonien commented May 5, 2023

same error for me too -- do we have a minimal repro steps for this?

curious to know if these tests are all still passing: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/expiring-todo-comments.mjs

EDIT: i see eslint update is causing this error, unsure how this broke it, but somehow it did
eslint/eslint#17107

@sindresorhus
Copy link
Owner

https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v46.0.1

lubber-de added a commit to fomantic/Fomantic-UI that referenced this issue May 8, 2023
lubber-de added a commit to fomantic/Fomantic-UI that referenced this issue May 8, 2023
saiichihashimoto added a commit to saiichihashimoto/sanity-typed that referenced this issue Jun 13, 2023
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.

4 participants