amilajack / eslint-plugin-compat

Check the browser compatibility of your code
MIT License
3.07k stars 104 forks source link

Support for ESLint 9 #614

Closed u01jmg3 closed 2 months ago

u01jmg3 commented 6 months ago

https://github.com/amilajack/eslint-plugin-compat/blob/eba26a7f65c26774fcbc46185a0ca7c5bcdc309d/package.json#L117

https://github.com/eslint/eslint/releases/tag/v9.0.0

herrherrmann commented 5 months ago

ESLint 9.0 also requires the flat config format, so this issue is probably kind of a duplicate of this older one? https://github.com/amilajack/eslint-plugin-compat/issues/603

u01jmg3 commented 5 months ago

Just need PR #609 to land. @amilajack can you help us out?

nford88 commented 4 months ago

Just need PR #609 to land. @amilajack can you help us out?

The flat config ticket was merged yesterday!

muuvmuuv commented 4 months ago

The next tag misses updated peerDependencies :)

u01jmg3 commented 3 months ago

Great work landing flat config file support 👏🏻

Will keep this issue open though because, as mentioned by @dargmuesli (https://github.com/amilajack/eslint-plugin-compat/pull/609#issuecomment-2123734301), currently this plugin doesn't fully support ESLint 9 due to the error: [context.getAncestors is not a function](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors())

dargmuesli commented 3 months ago

You can already use eslint-plugin-compat with eslint v9 by installing @eslint/compat and having this eslint.config.js:

// @ts-check

import { fixupConfigRules } from '@eslint/compat'
import eslintPluginCompat from 'eslint-plugin-compat'

const compatConfiguration = fixupConfigRules(
  eslintPluginCompat.configs['flat/recommended'],
)

export default [
  ...compatConfiguration,
]
u01jmg3 commented 3 months ago

Thanks 🙏🏻, @dargmuesli - could this method also be used with eslint-plugin-escompat?

dargmuesli commented 3 months ago

I think flat config must be supported.

Mr0grog commented 3 months ago

Are there any specific fixes that could use some help here? Happy to donate some time this week if help is needed to move ESLint 9 support forward.

dargmuesli commented 3 months ago

Great! 🥳 As mentioned

currently this plugin doesn't fully support ESLint 9 due to the error: [context.getAncestors is not a function](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors())

There might be some follow up issues that surface after this issue is fixed, but I don't think there are many as the compat workaround I posted above works pretty flawlessly.

Mr0grog commented 3 months ago

@dargmuesli that’s great, but mainly I’d like to hear from a maintainer (I guess that’s mainly @amilajack) what I can help do (or not help with). If maintainers are paying attention to ESLint v9 support, it’s not going to go very far just because I poke at it, and it’s not clear what they do or don’t need help with.

brettz9 commented 3 months ago

I've submitted #627 , a PR which should hopefully be a jump start on moving to ESLint 9 support. Hopefully someone can review and see if anything else needs to be done.

sdavids commented 2 months ago

Maybe update the changelog as well?

brettz9 commented 2 months ago

Looks like releases are getting made, but despite having @semantic-release/changelog set up, the change log does not appear to be updating for whatever reason... Not just the prereleases, but earlier versions...

brettz9 commented 2 months ago

@amilajack : I think this can be closed now (by #627)

brettz9 commented 2 months ago

Thanks!