eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

eslint v9 support

Open Techn1x opened this issue 1 year ago • 6 comments

There are aspects of this plugin that don't support eslint v9

TypeError: context.getAncestors is not a function from this line https://github.com/ember-cli/eslint-plugin-ember/blob/7e6bca993226891be07ad367f066323573b672aa/lib/rules/require-return-from-computed.js#L69-L70

context.getAncestors() is replaced in v9 https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors()

That's just the one I found, there is potentially other things that need to change for eslint v9

Techn1x avatar Apr 24 '24 06:04 Techn1x

Should have this resolved in : https://github.com/ember-cli/eslint-plugin-ember/pull/2153

LucasHill avatar Jun 25 '24 13:06 LucasHill

https://github.com/ember-cli/eslint-plugin-ember/pull/2153 was merged but there is at least one (and possibly more) deprecations. However the changes did unblock using the eslint/compat library to bring this plugin up to v9 compatibility. The usage in your eslint.config.mjs that's working for me is...

import { fixupConfigRules } from '@eslint/compat';
import emberRecommended from 'eslint-plugin-ember/configs/recommended';
const fixedEmberRecommended = fixupConfigRules(emberRecommended);
export default [
...yourOtherRules,
...fixedEmberRecommended
]

I'd still like to fix everything else to make this plugin work natively in v9 but if someone beats me to it go ahead.

LucasHill avatar Jun 25 '24 20:06 LucasHill

@NullVoxPopuli would it make sense to do a release to enable the above workaround until full support is in?

LucasHill avatar Jun 27 '24 14:06 LucasHill

perhaps!

I'd like to set up release-plan on this repo so releasing is less of a process (i.e.: can do it from the phone) -- but would need to discuss with @bmish <3

NullVoxPopuli avatar Jun 27 '24 14:06 NullVoxPopuli

I'm in favor of more automation for the release process, probably something like release-please in https://github.com/eslint/generator-eslint/pull/175. Contributions welcome if someone wants to improve it. For now, we have a command mentioned here: https://github.com/ember-cli/eslint-plugin-ember/blob/master/RELEASE.md

bmish avatar Jun 27 '24 22:06 bmish

I hope this will be resolved with my second attempt here: https://github.com/ember-cli/eslint-plugin-ember/pull/2159

LucasHill avatar Aug 12 '24 18:08 LucasHill

Was this resolved by #2159 with a fix released in 12.2.0?

JoshuaKGoldberg avatar Sep 04 '24 11:09 JoshuaKGoldberg

@JoshuaKGoldberg i am using the plugin on 12.2.0 on my large ember codebase with eslint 9 but i'm not sure what the done criteria are for this, such as getting the test suite running against eslint 9.

LucasHill avatar Sep 04 '24 15:09 LucasHill

That sounds like support to me 😄. But I'm not an Ember user so I'm not confident. If this issue gets closed by a maintainer then I'll just go ahead and mark a ✅ on https://github.com/eslint/eslint/issues/18093.

JoshuaKGoldberg avatar Sep 10 '24 20:09 JoshuaKGoldberg

seems to work fine on ESLint 9 now with the latest release. thanks everyone! :)

Turbo87 avatar Sep 10 '24 21:09 Turbo87

It does indeed seem to work 🎉

If anyone here's having dependency issues with ember-eslint-parser & eslint v9, this PR might be relevant to you https://github.com/ember-tooling/ember-eslint-parser/pull/95

Techn1x avatar Sep 11 '24 08:09 Techn1x