eslint-plugin-import-x: oxc-resolver has been a breaking change

I’ve just tried to update to latest version of the plugin. oxc-resolver appears incompatible with yarn PnP (at least out of the box).

Switching to the node-modules linker at least allows it to resolve packages, but it then seems to have some trouble importing .css files which previously worked without additional config.

{
    settings: {
      "import-x/resolver-next": [
        importPlugin.createNodeResolver({
          extensions: [".ts", ".tsx", ".js"],
          conditionNames: ["my-condition", "import"],
          extensionAlias: {
            ".js": [".ts", ".js"],
          },
        }),
      ],
      "import-x/internal-regex": "^@my-namespace/",
      "import-x/external-module-folders": [".yarn"],
      "import-x/parsers": {
        "@typescript-eslint/parser": [".ts", ".tsx"],
      },
    },

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 30 (30 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah if I figure out how to create a reproduction case. The only thing that may have some influence on the resolution may be that I have @org:registry=https://npm.org.com in .npmrc in the repo. import("@org/module") works just fine.

I tried original oxc-resolver, it’s not supported w/o pnp, but I think it should be supported. cc @Boshen

{
  "exports": {
    ".": "./index.js",
    "./add": "./add.js?custom"
  }
}

I’ll try to fix it at our own fork temporarily.

Yeah if I figure out how to create a reproduction case. The only thing that may have some influence on the resolution may be that I have @org:registry=https://npm.org.com in .npmrc in the repo. import("@org/module") works just fine.

Seems upgrading to latest version of this module and typescript-eslint has solved this for me, these errors no longer occur.

4.9.0 has fixed my CI…🤷🏻‍♂️ will monitor and raise a new issue if it crops up again. Thanks again for the quick turnaround on issues

This plugin was working fine at https://github.com/un-ts/eslint-plugin-import-x/releases/tag/v4.6.1. After the change to rspack-resolver, and notwithstanding the fixes mentioned above, https://github.com/un-ts/eslint-plugin-import-x/releases/tag/v4.8.0 is now failling intermittently (but very frequently) on CI only. Nothing in the debug logs from this plugin or rspack-resolve hint at why.

I’ll raise a new issue if I can make a repro, but as it’s only happening on my CI that’s proving a bit tricky.

@mrginglymus Could you help to test #243?

# yarn 1
yarn add https://pkg.csb.dev/un-ts/eslint-plugin-import-x/commit/d794a858/eslint-plugin-import-x
# yarn 2, 3
yarn add eslint-plugin-import-x@https://pkg.csb.dev/un-ts/eslint-plugin-import-x/commit/d794a858/eslint-plugin-import-x/_pkg.tgz
# npm
npm i https://pkg.csb.dev/un-ts/eslint-plugin-import-x/commit/d794a858/eslint-plugin-import-x