eslint-plugin-import-x: What breaking changes should be included in the next major version (v5) release?

  • Drop Node.js 18 supports We will keep Node.js 18 supports, but the plugin will go ESM-only
    • This allows eslint-plugin-import-x to become ESM-only
    • If we only target Node.js 20+, then require(ESM) will be available in eslint.config.cjs.
    • On Node.js 20+ you can still use require('eslint-plugin-import-x') w/o changes
    • On Node.js 18 you will have to use import and eslint.config.mjs, but the rest of your app can remain CommonJS only.
  • Make import resolver interface v3 default for import-x/resolver
    • Resolvers using the v1 and v2 interface can be wrapped within our built-in compat utility, or be configured using the import-x/resolver-legacy options (which will be removed in v6 I guess?).
    • With the v3 interface, it is way easier for custom resolvers to share instances across invocations, significantly improving the performance, see https://github.com/un-ts/eslint-plugin-import-x/pull/192
  • Drop eslint-import-resolver-node with our built-in https://github.com/un-ts/eslint-plugin-import-x/issues/208 https://github.com/un-ts/eslint-plugin-import-x/issues/209
    • Technically, this is not a breaking change since the resolve behavior will not change. But we support imports and exports maps. This is because ljharb refuses to implement such features in eslint-import-resolver-node and even locks the related issue.
  • enable fix option by default extensions rule, related #327 and #329

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 27 (12 by maintainers)

Most upvoted comments

if you want something lightweight, i’d use npm workspaces & wireit

otherwise i’d probably use nx

That’s true. Seems we’re all in agreement 🥳

It is scary times making such a big decision but I think we can set a good example here for others to follow. If we can figure it out, it’d be really great

But if we don’t raise the engine constraints, we will have to write a detailed docs explaining:

  • We recommend upgrading to Node.js 20+ so you can both require and import eslint-plugin-import-x
  • If you need to stick with Node.js 18, you will have to use eslint.config.mjs, but it is OK, the rest of your app can still be CJS.

If we raise the engine constraints to 20+, then there will be no changes needed toward eslint.config.cjs, only upgrading Node.js.

@JounQin @43081j So what do you think, should we raise the engine constraints or not?

Drop Node.js 18 supports

I don’t see quite benefits to become ESM only for a widely used ESLint plugin at this time

Make import resolver interface v3 default for import-x/resolver

I forget to suggest use extra options instead of resolver as described at https://github.com/import-js/eslint-plugin-import/issues/2108#issuecomment-1205016584 and https://github.com/import-js/eslint-plugin-import/pull/2519

I don’t know whether would it be possible to support it without breaking changes

Drop eslint-import-resolver-node with our built-in

Great to replace enhanced-resolver with oxc-resolver inside.

I’ll investigate import.meta.resolve solution failing cases in the next few days.