style-guide icon indicating copy to clipboard operation
style-guide copied to clipboard

Error when linting after upgrade to v6

Open neil-sola opened this issue 1 year ago • 5 comments

pnpm lint results in:

workflow-api:lint: Oops! Something went wrong! :(
workflow-api:lint: 
workflow-api:lint: ESLint: 8.57.0
workflow-api:lint: 
workflow-api:lint: TypeError: Cannot destructure property 'parent' of 'node' as it is undefined.
workflow-api:lint: Occurred while linting /Users/neil/sola/monorepo/serverless/workflow-api/src/v1/delete-workflow.ts:1
workflow-api:lint: Rule: "unused-imports/no-unused-imports"
workflow-api:lint:     at exports.unusedImportsPredicate (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-unused-imports/lib/rules/predicates.js:28:13)
workflow-api:lint:     at Object.value [as report] (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint-rule-composer/lib/rule-composer.js:144:25)
workflow-api:lint:     at Program:exit (/Users/neil/sola/monorepo/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js:301:33)
workflow-api:lint:     at ruleErrorHandler (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1076:28)
workflow-api:lint:     at /Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:58
workflow-api:lint:     at Array.forEach (<anonymous>)
workflow-api:lint:     at Object.emit (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
workflow-api:lint:     at NodeEventGenerator.applySelector (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
workflow-api:lint:     at NodeEventGenerator.applySelectors (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
workflow-api:lint:     at NodeEventGenerator.leaveNode (/Users/neil/sola/monorepo/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/node-event-generator.js:349:14)

neil-sola avatar May 20 '24 17:05 neil-sola

My two cents here. I just had the same error and I found that it comes from eslint-plugin-unused-imports node_modules/eslint-plugin-unused-imports/lib/rules/predicates.js line 27

put a console log just after

	const { node } = problem;
	console.log('problem', problem);

And you will see what is causing the issue for you.

I think unused-imports plugin has changed and is missing something.

maufarinelli avatar Jun 07 '24 17:06 maufarinelli

Hi, unfortunately i'm facing the same issue and didn't find a fix yet

SoumayaBessifi avatar Jun 12 '24 17:06 SoumayaBessifi

The problem starts to appear on the @typescript-eslint/[email protected]

dmitry-stepanenko avatar Jul 18 '24 13:07 dmitry-stepanenko

I had this problem and fixed it by upgrading to [email protected]

dieguezz avatar Aug 20 '24 13:08 dieguezz

@dieguezz that did the job!

dmitry-stepanenko avatar Aug 20 '24 16:08 dmitry-stepanenko