eslint-plugin-compat
eslint-plugin-compat copied to clipboard
feat: support flat config
!! IMPORTANT !!
If user previously imported this package using ESM, import { configs, rules } from 'eslint-plugin-compat'
will not work.
This is a BREAKING CHANGE, so need to increase a major version to release it.
If you agree to a major version upgrade, it would be good to also remove config
.
If you don't want to make a BREAKING CHANGE, I can maintain compatibility by splitting the package entry point into .mts
and .cts
. (I had implemented it once, but the code was too complicated, so I deleted it for now: https://github.com/amilajack/eslint-plugin-compat/commit/686d75a45bc84c33071ca36b5efb497fd0143044)
Please feel free to let me know which method you prefer. :)
What's Changed
- Support flat config (Thank you for being a reference, eslint-plugin-n!)
- Bump dependencies
- Fix test errors with update snapshots
- Replace babel-eslint to @babel/eslint-parser (See: https://github.com/babel/babel-eslint#note-babel-eslint-is-now-babeleslint-parser-and-has-moved-into-the-babel-monorepo)
- Deprecate named export
- Provide type declaration
Resolves: #603
P.S. ESLint v9 has been released. IMO, it's a good time to drop support for versions below ESLint v8.57.0!
@amilajack now that eslint v9 is released, do you think merging this would be an option for you? :pray:
Sorry for the delay here. I've published this as eslint-plugin-compat@next
. Feel free to test, as I will as well.
Thank you @amilajack! I tried 5.0.0-2
in a project of mine and it looks good.
@nix6839 I understand that this PR only adds flat config support. I still want to mention that with ESLint v9.3.0 I get the TypeError: context.getAncestors is not a function. Might be possible to fix this in this PR too as described under the link?
@nix6839 I understand that this PR only adds flat config support. I still want to mention that with ESLint v9.3.0 I get the TypeError: context.getAncestors is not a function. Might be possible to fix this in this PR too as described under the link?
I think it's going to be a big task, so it should be worked on in a separate PR.
Might be possible to fix this in this PR too as described under the link?
@dargmuesli would you be interested in submitting a PR for this?
would you be interested in submitting a PR for this?
Out of time right now. Depending on other work on this I might come back to it in the future. Other contributions are welcome.