Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Oct 14, 2024

Note: This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
eslint-plugin-import-x ^0.5.2^4.16.1 age confidence

Release Notes

un-ts/eslint-plugin-import-x (eslint-plugin-import-x)

v4.16.1

Compare Source

Patch Changes

v4.16.0

Compare Source

Minor Changes
Patch Changes

v4.15.2

Compare Source

Patch Changes

v4.15.1

Compare Source

Patch Changes

v4.15.0

Compare Source

Minor Changes

v4.14.2

Compare Source

Patch Changes

v4.14.1

Compare Source

Patch Changes

v4.14.0

Compare Source

Minor Changes
Patch Changes

v4.13.3

Compare Source

Patch Changes

v4.13.2

Compare Source

Patch Changes

v4.13.1

Compare Source

Patch Changes

v4.13.0

Compare Source

Minor Changes

v4.12.2

Compare Source

Patch Changes

v4.12.1

Compare Source

Patch Changes

v4.12.0

Compare Source

Minor Changes

v4.11.1

Compare Source

Patch Changes

v4.11.0

Compare Source

Minor Changes

v4.10.6

Compare Source

Patch Changes

v4.10.5

Compare Source

Patch Changes

v4.10.4

Compare Source

Patch Changes

v4.10.3

Compare Source

Patch Changes
  • #​292 1342127 Thanks @​JounQin! - refactor: remove unnecessary check for pnpapi because unrs-resolver already handles it

v4.10.2

Compare Source

Patch Changes

v4.10.1

Compare Source

Patch Changes

v4.10.0

Compare Source

Minor Changes
Patch Changes

v4.9.4

Compare Source

Patch Changes

v4.9.3

Compare Source

Patch Changes
  • #​263 c0046a9 Thanks @​JounQin! - chore: migrate to rebranding unrs-resolver with new targets supported:
    • i686-pc-windows-msvc
    • armv7-unknown-linux-musleabihf
    • powerpc64le-unknown-linux-gnu
    • s390x-unknown-linux-gnu

v4.9.2

Compare Source

Patch Changes

v4.9.1

Compare Source

Patch Changes

v4.9.0

Compare Source

Minor Changes

v4.8.1

Compare Source

Patch Changes

v4.8.0

Compare Source

Minor Changes

v4.7.2

Compare Source

Patch Changes

v4.7.1

Compare Source

Patch Changes

v4.7.0

Compare Source

Minor Changes
Patch Changes

v4.6.1

Compare Source

Patch Changes

v4.6.0

Compare Source

Minor Changes
  • #​209 46d2360 Thanks @​SukkaW! - When eslint-plugin-import-x was forked from eslint-plugin-import, we copied over the default resolver (which is eslint-import-resolver-node) as well. However, this resolver doesn't supports exports in the package.json file, and the current maintainer of the eslint-import-resolver-node (ljharb) doesn't have the time implementing this feature and he locked the issue import-js/eslint-plugin-import#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 the eslint-import-resolver-node and use this new resolver by default. In the meantime, you can try out this new resolver by setting the import-x/resolver-next option in your eslint.config.js file:

    // eslint.config.js
    const eslintPluginImportX = require('eslint-plugin-import-x');
    const { createNodeResolver } = eslintPluginImportX;
    
    module.exports = {
      plugins: {
        'import-x': eslintPluginImportX,
      },
      settings: {
        'import-x/resolver-next': [
          // This is the new resolver we are introducing
          createNodeResolver({
            /**
             * The allowed extensions the resolver will attempt to find when resolving a module
             * By default it uses a relaxed extension list to search for both ESM and CJS modules
             * You can customize this list to fit your needs
             *
             * @​default ['.mjs', '.cjs', '.js', '.json', '.node']
             */
            extensions?: string[];
            /**
             * Optional, the import conditions the resolver will used when reading the exports map from "package.json"
             * By default it uses a relaxed condition list to search for both ESM and CJS modules
             * You can customize this list to fit your needs
             *
             * @​default ['default', 'module', 'import', 'require']
             */
            conditions: ['default', 'module', 'import', 'require'],
            // You can pass more options here, see the enhanced-resolve documentation for more details
            // https://github.com/webpack/enhanced-resolve/tree/v5.17.1?tab=readme-ov-file#resolver-options
          }),
          // you can add more resolvers down below
          require('eslint-import-resolver-typescript').createTypeScriptImportResolver(
            /** options of eslint-import-resolver-typescript */
          )
        ],
      },
    };

    We do not plan to implement reading baseUrl and paths from the tsconfig.json file in this resolver. If you need this feature, please checkout eslint-import-resolver-typescript (also powered by enhanced-resolve), eslint-import-resolver-oxc (powered by oxc-resolver), eslint-import-resolver-next (also powered by oxc-resolver), or other similar resolvers.

Patch Changes

v4.5.1

Compare Source

Patch Changes

v4.5.0

Compare Source

Minor Changes
For eslint-plugin-import-x users

Like 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 setting import-x/resolver-next:

// eslint.config.js
import { createTsResolver } from '#custom-resolver';
const { createOxcResolver } = require('path/to/a/custom/resolver');

const resolverInstance = new ResolverFactory({});
const customResolverObject = {
  interfaceVersion: 3,
  name: 'my-custom-eslint-import-resolver',
  resolve(modPath, sourcePath) {
    const path = resolverInstance.resolve(modPath, sourcePath);
    if (path) {
      return {
        found: true,
        path
      };
    }

    return {
      found: false,
      path: null
    }
  };
};

module.exports = {
  settings: {
    // multiple resolvers
    'import-x/resolver-next': [
      customResolverObject,
      createTsResolver(enhancedResolverOptions),
      createOxcResolver(oxcOptions),
    ],
    // single resolver:
    'import-x/resolver-next': [createOxcResolver(oxcOptions)]
  }
}

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 with import-x/resolver.

In the next major version of eslint-plugin-import-x (v5), we will rename the currently existing import-x/resolver to import-x/resolver-legacy (which allows the existing ESLint legacy config users to use their existing resolver settings), and import-x/resolver-next will become the new import-x/resolver. When ESLint v9 (the last ESLint version with ESLint legacy config support) reaches EOL in the future, we will remove import-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:

// When migrating to `import-x/resolver-next`, you CAN'T use legacy versions of resolvers directly:
module.exports = {
  settings: {
    // THIS WON'T WORK, the resolver interface required for `import-x/resolver-next` is different.
    'import-x/resolver-next': [
       require('eslint-import-resolver-node'),
       require('eslint-import-resolver-webpack'),
       require('some-custom-resolver')
    ];
  }
}

For easier migration, the PR also introduces a compat utility importXResolverCompat that you can use in your eslint.config.js:

// eslint.config.js
import eslintPluginImportX, { importXResolverCompat } from 'eslint-plugin-import-x';
// or
const eslintPluginImportX = require('eslint-plugin-import-x');
const { importXResolverCompat } = eslintPluginImportX;

module.exports = {
  settings: {
    // THIS WILL WORK as you have wrapped the previous version of resolvers with the `importXResolverCompat`
    'import-x/resolver-next': [
       importXResolverCompat(require('eslint-import-resolver-node'), nodeResolveOptions),
       importXResolverCompat(require('eslint-import-resolver-webpack'), webpackResolveOptions),
       importXResolverCompat(require('some-custom-resolver'), { option1: true, option2: '' })
    ];
  }
}
For custom import resolver developers

This is the new API design of the resolver interface:

export interface NewResolver {
  interfaceVersion: 3
  name?: string // This will be included in the debug log
  resolve: (modulePath: string, sourceFile: string) => ResolvedResult
}

// The `ResultNotFound` (returned when not resolved) is the same, no changes
export interface ResultNotFound {
  found: false
  path?: undefined
}

// The `ResultFound` (returned resolve result) is also the same, no changes
export interface ResultFound {
  found: true
  path: string | null
}

export type ResolvedResult = ResultNotFound | ResultFound

You will be able to import NewResolver from eslint-plugin-import-x.

The most notable change is that eslint-plugin-import-x no longer passes the third argument (options) to the resolve 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 the eslint.config.js to get the actual resolver:

// custom-resolver.js
exports.createCustomResolver = (options) => {
  // The options are consumed outside the `resolve` function.
  const resolverInstance = new ResolverFactory(options);

  return {
    name: 'custom-resolver',
    interfaceVersion: 3,
    resolve(mod, source) {
      const found = resolverInstance.resolve(mod, {});

      // Of course, you still have access to the `options` variable here inside
      // the `resolve` function. That's the power of JavaScript Closures~
    }
  }
};

// eslint.config.js
const { createCustomResolver } = require('custom-resolver')

module.exports = {
  settings: {
    'import-x/resolver-next': [
       createCustomResolver(options)
    ];
  }
}

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 the resolve function is called:

module.exports = {
  interfaceVersion: 2,
  resolve(mod, source) {
    // every time the `resolve` function is called, a new instance is created
    // This is very slow
    const resolverInstance = ResolverFactory.createResolver({})
    const found = resolverInstance.resolve(mod, {})
  },
}

With the factory function pattern, you can create a resolver instance beforehand:

exports.createCustomResolver = options => {
  // `enhance-resolve` allows you to create a reusable instance:
  const resolverInstance = ResolverFactory.createResolver({})
  const resolverInstance = enhanceResolve.create({})

  // `oxc-resolver` also allows you to create a reusable instance:
  const resolverInstance = new ResolverFactory({})

  return {
    name: 'custom-resolver',
    interfaceVersion: 3,
    resolve(mod, source) {
      // the same re-usable instance is shared across `resolve` invocations.
      // more performant
      const found = resolverInstance.resolve(mod, {})
    },
  }
}
Patch Changes

v4.4.3

Compare Source

Patch Changes

v4.4.2

Compare Source

Patch Changes

v4.4.0

Compare Source

Minor Changes
Patch Changes

v4.3.1

Compare Source

Patch Changes
  • #​162 38d0081 Thanks @​AaronMoat! - Fix issue where no-duplicates rule with prefer-inline incorrectly marks default type and named type imports as duplicates

v4.3.0

Compare Source

Minor Changes

v4.2.1

Compare Source

Patch Changes

v4.2.0

Compare Source

Minor Changes
Patch Changes

v4.1.1

Compare Source

Patch Changes

v4.1.0

Compare Source

Minor Changes
  • #​122 cd52e86 Thanks @​michaelfaith! - Add ESLint flat configuration presets. You can access them with:

    import eslintPluginImportX from 'eslint-plugin-import-x'
    
    eslintPluginImportX.flatConfigs.recommended
    eslintPluginImportX.flatConfigs.react
    eslintPluginImportX.flatConfigs.typescript
    eslintPluginImportX.flatConfigs.electron
  • #​132 9948c78 Thanks @​SukkaW! - Added no-rename-default that forbid importing a default export by a different name. Originally created by @​whitneyit, ported by @​SukkaW

v4.0.0

Compare Source

Major Changes
  • #​112 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.

v3.1.0

Compare Source

Minor Changes
Patch Changes
  • #​118 0307ff2 Thanks @​SukkaW! - Reverts #​111. The introduction of SCC causes extra overhead that overcomes the early return it introduced.

    A new no-cycle-next rule is being implemented using the graph. It won't be backward compatible with the current rule no-cycle. The current no-cycle rule will become no-cycle-legacy in the next major version.

v3.0.1

Compare Source

Patch Changes

v3.0.0

Compare Source

Major Changes
  • #​106 19f10aa Thanks @​SukkaW! - eslint-plugin-import-x is a fork of eslint-plugin-import that aims to provide a more performant and more lightweight version of the original plugin.

    Due to the nature of the fork, all eslint-plugin-import's git tags and releases have been copied over to eslint-plugin-import-x. This causes version conflicts when publishing new versions of eslint-plugin-import-x.

    To prevent this, we have decided to publish a new major version of eslint-plugin-import-x that will not conflict with the original eslint-plugin-import's versions.

    See also #​76

Patch Changes

v0.5.3

Compare Source

Patch Changes

Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@vercel
Copy link

vercel bot commented Oct 14, 2024

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
unconfig Ready Ready Preview Comment Dec 4, 2025 7:55am

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2024

⚠️ No Changeset found

Latest commit: 4b7523e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@i7eo
Copy link
Owner

i7eo commented Jan 21, 2025

Marking pull request as stale since there was no activity for 30 days

@i7eo i7eo added the stale label Jan 21, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from bee81dc to 4f0dc19 Compare March 14, 2025 23:32
@i7eo i7eo removed the stale label Mar 15, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 4f0dc19 to 964126b Compare March 16, 2025 12:13
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 964126b to 0f22352 Compare March 20, 2025 00:02
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 0f22352 to 9d56dc7 Compare March 22, 2025 00:04
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 9d56dc7 to a6b5636 Compare March 27, 2025 04:14
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from a6b5636 to d1c9a81 Compare March 30, 2025 15:56
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from d1c9a81 to 09c2a22 Compare April 2, 2025 03:40
@i7eo
Copy link
Owner

i7eo commented Aug 5, 2025

Marking pull request as stale since there was no activity for 30 days

@i7eo i7eo added the stale label Aug 5, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 07db327 to 5691b49 Compare August 11, 2025 03:37
@i7eo i7eo removed the stale label Aug 11, 2025
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 5691b49 to 62f4ae6 Compare August 15, 2025 07:27
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 62f4ae6 to 2e2be20 Compare August 24, 2025 15:08
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 2e2be20 to a68d234 Compare September 1, 2025 06:26
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from a68d234 to 9cfa975 Compare September 26, 2025 07:08
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 9cfa975 to 6291777 Compare October 25, 2025 07:16
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 6291777 to 0293f21 Compare November 16, 2025 19:43
@renovate renovate bot force-pushed the renovate/eslint-plugin-import-x-4.x branch from 0293f21 to c45c56c Compare November 19, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants