eslint-plugin-import-x: What breaking changes should be included in the next major version (v5) release?
-
Drop Node.js 18 supportsWe will keep Node.js 18 supports, but the plugin will go ESM-onlyThis allowseslint-plugin-import-xto become ESM-onlyIf we only target Node.js 20+, thenrequire(ESM)will be available ineslint.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
importandeslint.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-legacyoptions (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
- Resolvers using the v1 and v2 interface can be wrapped within our built-in compat utility, or be configured using the
- Drop
eslint-import-resolver-nodewith 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
importsandexportsmaps. This is because ljharb refuses to implement such features ineslint-import-resolver-nodeand even locks the related issue.
- Technically, this is not a breaking change since the resolve behavior will not change. But we support
- enable
fixoption by defaultextensionsrule, related #327 and #329
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 27 (12 by maintainers)
if you want something lightweight, i’d use npm workspaces & wireit
otherwise i’d probably use nx
But if we don’t raise the engine constraints, we will have to write a detailed docs explaining:
eslint-plugin-import-xeslint.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?
I don’t see quite benefits to become ESM only for a widely used ESLint plugin at this time
I forget to suggest use extra
optionsinstead ofresolveras described at https://github.com/import-js/eslint-plugin-import/issues/2108#issuecomment-1205016584 and https://github.com/import-js/eslint-plugin-import/pull/2519I don’t know whether would it be possible to support it without breaking changes
Great to replace
enhanced-resolverwithoxc-resolverinside.I’ll investigate
import.meta.resolvesolution failing cases in the next few days.