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

eslint v9 support #2136

Closed
Techn1x opened this issue Apr 24, 2024 · 11 comments
Closed

eslint v9 support #2136

Techn1x opened this issue Apr 24, 2024 · 11 comments

Comments

@Techn1x
Copy link

Techn1x commented Apr 24, 2024

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

TypeError: context.getAncestors is not a function
from this line

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

@LucasHill
Copy link
Contributor

LucasHill commented Jun 25, 2024

Should have this resolved in : #2153

@LucasHill
Copy link
Contributor

#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
Copy link
Contributor

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

@NullVoxPopuli
Copy link
Contributor

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

@bmish
Copy link
Member

bmish commented Jun 27, 2024

I'm in favor of more automation for the release process, probably something like release-please in eslint/generator-eslint#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

@LucasHill
Copy link
Contributor

I hope this will be resolved with my second attempt here:
#2159

@JoshuaKGoldberg
Copy link

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

@LucasHill
Copy link
Contributor

@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.

@JoshuaKGoldberg
Copy link

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 eslint/eslint#18093.

@Turbo87 Turbo87 closed this as completed Sep 10, 2024
@Turbo87
Copy link
Member

Turbo87 commented Sep 10, 2024

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

@Techn1x
Copy link
Author

Techn1x commented Sep 11, 2024

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
ember-tooling/ember-eslint-parser#95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants