[BUMP] Update dependency eslint-plugin-import-x to v4 (api) #10911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.1.0
->^4.0.0
Release Notes
un-ts/eslint-plugin-import-x (eslint-plugin-import-x)
v4.6.1
Compare Source
Patch Changes
be9c3e8
Thanks @mrginglymus! - Fix enhanced-resolve dependencyv4.6.0
Compare Source
Minor Changes
#209
46d2360
Thanks @SukkaW! - Wheneslint-plugin-import-x
was forked fromeslint-plugin-import
, we copied over the default resolver (which iseslint-import-resolver-node
) as well. However, this resolver doesn't supportsexports
in thepackage.json
file, and the current maintainer of theeslint-import-resolver-node
(ljharb) doesn't have the time implementing this feature and he locked the issue https://github.com/import-js/eslint-plugin-import/issues/1810.So we decided to implement our own resolver that "just works". The new resolver is built upon the
enhanced-resolve
that implements the full Node.js Resolver Algorithm. The new resolver only implements the import resolver interface v3, which means you can only use it with ESLint Flat config. For more details about the import resolver interface v3, please check out #192.In the next major version of
eslint-plugin-import-x
, we will remove theeslint-import-resolver-node
and use this new resolver by default. In the meantime, you can try out this new resolver by setting theimport-x/resolver-next
option in youreslint.config.js
file:We do not plan to implement reading
baseUrl
andpaths
from thetsconfig.json
file in this resolver. If you need this feature, please checkout eslint-import-resolver-typescript (also powered byenhanced-resolve
), eslint-import-resolver-oxc (powered byoxc-resolver
), eslint-import-resolver-next (also powered byoxc-resolver
), or other similar resolvers.Patch Changes
449738f
Thanks @privatenumber! - insert type prefix without new linev4.5.1
Compare Source
Patch Changes
#198
ac6d2e1
Thanks @voxpelli! - Fix #197 with missing types#204
32e9b55
Thanks @privatenumber! - fix type-import and value-import merging when import-as is usedv4.5.0
Compare Source
Minor Changes
fbf639b
Thanks @SukkaW! - The PR implements the new resolver design proposed in https://github.com/un-ts/eslint-plugin-import-x/issues/40#issuecomment-2381444266For
eslint-plugin-import-x
usersLike the ESLint flat config allows you to use js objects (e.g. import and require) as ESLint plugins, the new
eslint-plugin-import-x
resolver settings allow you to use js objects as custom resolvers through the new settingimport-x/resolver-next
:The new
import-x/resolver-next
no longer accepts strings as the resolver, thus will not be compatible with the ESLint legacy config (a.k.a..eslintrc
). Those who are still using the ESLint legacy config should stick withimport-x/resolver
.In the next major version of
eslint-plugin-import-x
(v5), we will rename the currently existingimport-x/resolver
toimport-x/resolver-legacy
(which allows the existing ESLint legacy config users to use their existing resolver settings), andimport-x/resolver-next
will become the newimport-x/resolver
. When ESLint v9 (the last ESLint version with ESLint legacy config support) reaches EOL in the future, we will removeimport-x/resolver-legacy
.We have also made a few breaking changes to the new resolver API design, so you can't use existing custom resolvers directly with
import-x/resolver-next
:For easier migration, the PR also introduces a compat utility
importXResolverCompat
that you can use in youreslint.config.js
:For custom import resolver developers
This is the new API design of the resolver interface:
You will be able to import
NewResolver
fromeslint-plugin-import-x/types
.The most notable change is that
eslint-plugin-import-x
no longer passes the third argument (options
) to theresolve
function.We encourage custom resolvers' authors to consume the options outside the actual
resolve
function implementation. You can export a factory function to accept the options, this factory function will then be called inside theeslint.config.js
to get the actual resolver:This allows you to create a reusable resolver instance to improve the performance. With the existing version of the resolver interface, because the options are passed to the
resolver
function, you will have to create a resolver instance every time theresolve
function is called:With the factory function pattern, you can create a resolver instance beforehand:
Patch Changes
#184
bc4de89
Thanks @marcalexiei! - fix(no-cycle): improves the type declaration of the ruleno-cycle
’smaxDepth
option#184
bc4de89
Thanks @marcalexiei! - fix(first): improves the type declaration of the rulefirst
's option#184
bc4de89
Thanks @marcalexiei! - fix(no-unused-modules): improves the type declaration of the ruleno-unused-modules
’smissingExports
option#184
bc4de89
Thanks @marcalexiei! - fix(no-deprecated): improve error message when no description is availablev4.4.3
Compare Source
Patch Changes
a428f82
Thanks @SukkaW! - AttachecmaVersion
andsourceType
toparserOptions
during parsev4.4.2
Compare Source
Patch Changes
cc4ee65
Thanks @SukkaW! - Fix #144, read propersourceType
for both eslint flat config and legacy eslintrc config.v4.4.0
Compare Source
Minor Changes
9c58269
Thanks @teidesu! - Add new rule optioncheckTypedImports
forextensions
, backports https://github.com/import-js/eslint-plugin-import/pull/2817Patch Changes
#171
9715220
Thanks @SukkaW! - Perf: avoid regexp during parser choosing#171
9715220
Thanks @SukkaW! - Add extra guard for ruleno-named-as-default
. A few guards are borrowed from https://github.com/import-js/eslint-plugin-import/pull/3032, but we don't sync the rest of changes from upstream since we have already implemented a way more performant check.#171
9715220
Thanks @SukkaW! - More test cases forno-named-export
andno-defualt-export
rule specifically with non-modulesourceType
#171
9715220
Thanks @SukkaW! - Fixexport
when there is only oneTSDeclareFunction
(https://github.com/import-js/eslint-plugin-import/pull/3065)#171
9715220
Thanks @SukkaW! - PreventExportMap
's cache is being tainted by incompatible parser (e.g. oldbabel-eslint
). The cache is now skipped w/ incompatible parsers, which might introduce performance impacts only for those who are using incompatible parsers. (https://github.com/import-js/eslint-plugin-import/pull/3062)#171
9715220
Thanks @SukkaW! - Docs: fix a few typos here and there#168
5de039c
Thanks @hyoban! - Fixes https://github.com/un-ts/eslint-plugin-import-x/issues/167, theno-duplicates
rule now allows co-existing inline type imports and namespace imports.#171
9715220
Thanks @SukkaW! - Properly fix espree parser w/ ESLint Flat Configv4.3.1
Compare Source
Patch Changes
38d0081
Thanks @AaronMoat! - Fix issue whereno-duplicates
rule withprefer-inline
incorrectly marks default type and named type imports as duplicatesv4.3.0
Compare Source
Minor Changes
4da5388
Thanks @GoodbyeNJN! - feat: add support for using resolver object directly in settingsv4.2.1
Compare Source
Patch Changes
#148
d228129
Thanks @SukkaW! - Fixnewline-after-import
'sconsiderComments
options when lintingrequire
, backports https://github.com/import-js/eslint-plugin-import/pull/2952#147
eca73ed
Thanks @nchevsky! - Fix regression in ruleno-unused-modules
which would incorrectly initialize optionsrc
to[]
instead of[process.cwd()]
, breaking file discovery.#148
d228129
Thanks @SukkaW! - Fixno-duplicates
for TypeScript, backports https://github.com/import-js/eslint-plugin-import/pull/3033v4.2.0
Compare Source
Minor Changes
f12447e
Thanks @Zamiell! - Add new option "whitelist" for rule "no-extraneous-dependencies"Patch Changes
e5e4580
Thanks @SukkaW! - Fix https://github.com/nuxt/eslint/issues/494 by avoid importing from@typescript-eslint/typescript-estree
.v4.1.1
Compare Source
Patch Changes
757ffa9
Thanks @SukkaW! - Fix #123 where the ruleno-named-as-default
will confuse TypeScript namespace exports with actual exports.v4.1.0
Compare Source
Minor Changes
#122
cd52e86
Thanks @michaelfaith! - Add ESLint flat configuration presets. You can access them with:#132
9948c78
Thanks @SukkaW! - Addedno-rename-default
that forbid importing a default export by a different name. Originally created by @whitneyit, ported by @SukkaWv4.0.0
Compare Source
Major Changes
4ba14da
Thanks @SukkaW! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.Configuration
📅 Schedule: Branch creation - "every 1 hour every weekday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.