Closed jpzwarte closed 4 months ago
Hi @jpzwarte! Will look into eslint 9 compatibility this week
Just encountered this. Is there a workaround?
Oops! Something went wrong! :(
ESLint: 9.1.1
TypeError: context.getAncestors is not a function
Occurred while linting [...]/test/common-helpers.ts:240
Rule: "chai-friendly/no-unused-expressions"
at ExpressionStatement ([...]/test/node_modules/eslint-plugin-chai-friendly/lib/rules/no-unused-expressions.js:262:50)
at ruleErrorHandler ([...]/test/node_modules/eslint/lib/linter/linter.js:1115:48)
at [...]/test/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit ([...]/test/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector ([...]/test/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors ([...]/test/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
at NodeEventGenerator.enterNode ([...]/test/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
at runRules ([...]/test/node_modules/eslint/lib/linter/linter.js:1154:40)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors ([...]/test/node_modules/eslint/lib/linter/linter.js:1880:31)
@ihordiachenko
https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/ gives a code example for updating
[context.getAncestors()
](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors()) so that it is compatible with ESLint >= 9.0.0
and earlier versions.
@crfrolik
Just encountered this. Is there a workaround?
Oops! Something went wrong! :( ESLint: 9.1.1 TypeError: context.getAncestors is not a function
ESLint published the Blog post Introducing ESLint Compatibility Utilities yesterday announcing a new utility @eslint/compat to work around compatibility issues like this.
@ihordiachenko
Would you like a PR to fix this issue or are you already planning to do it yourself?
@ihordiachenko
@MikeMcC399 released in eslint-plugin-chai-friendly@0.8.0
@ihordiachenko
released in
eslint-plugin-chai-friendly@0.8.0
Thank you very much! I am just testing with Cypress and ESLint v9 flat configuration and it all looks good! 👍🏻
Works fine with eslint 8.57.0
Uses version 0.7.4 of the plugin.