Skip to content

Commit ae7432f

Browse files
chore: release eslint-plugin-import-x
1 parent 46d2360 commit ae7432f

File tree

4 files changed

+58
-58
lines changed

4 files changed

+58
-58
lines changed

.changeset/tame-melons-notice.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/witty-garlics-destroy.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# eslint-plugin-import-x
22

3+
## 4.6.0
4+
5+
### Minor Changes
6+
7+
- [#209](https://github.com/un-ts/eslint-plugin-import-x/pull/209) [`46d2360`](https://github.com/un-ts/eslint-plugin-import-x/commit/46d2360f5ebfbd79e74a0828ac7e280973510454) Thanks [@SukkaW](https://github.com/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 https://github.com/import-js/eslint-plugin-import/issues/1810.
8+
9+
So we decided to implement our own resolver that "just works". The new resolver is built upon the [`enhanced-resolve`](https://www.npmjs.com/package/enhanced-resolve) that implements the full Node.js [Resolver Algorithm](https://nodejs.org/dist/v14.21.3/docs/api/esm.html#esm_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](https://github.com/un-ts/eslint-plugin-import-x/pull/192).
10+
11+
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:
12+
13+
```js
14+
// eslint.config.js
15+
const eslintPluginImportX = require('eslint-plugin-import-x');
16+
const { createNodeResolver } = eslintPluginImportX;
17+
18+
module.exports = {
19+
plugins: {
20+
'import-x': eslintPluginImportX,
21+
},
22+
settings: {
23+
'import-x/resolver-next': [
24+
// This is the new resolver we are introducing
25+
createNodeResolver({
26+
/**
27+
* The allowed extensions the resolver will attempt to find when resolving a module
28+
* By default it uses a relaxed extension list to search for both ESM and CJS modules
29+
* You can customize this list to fit your needs
30+
*
31+
* @default ['.mjs', '.cjs', '.js', '.json', '.node']
32+
*/
33+
extensions?: string[];
34+
/**
35+
* Optional, the import conditions the resolver will used when reading the exports map from "package.json"
36+
* By default it uses a relaxed condition list to search for both ESM and CJS modules
37+
* You can customize this list to fit your needs
38+
*
39+
* @default ['default', 'module', 'import', 'require']
40+
*/
41+
conditions: ['default', 'module', 'import', 'require'],
42+
// You can pass more options here, see the enhanced-resolve documentation for more details
43+
// https://github.com/webpack/enhanced-resolve/tree/v5.17.1?tab=readme-ov-file#resolver-options
44+
}),
45+
// you can add more resolvers down below
46+
require('eslint-import-resolver-typescript').createTypeScriptImportResolver(
47+
/** options of eslint-import-resolver-typescript */
48+
)
49+
],
50+
},
51+
};
52+
```
53+
54+
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](https://www.npmjs.com/package/eslint-import-resolver-typescript) (also powered by `enhanced-resolve`), [eslint-import-resolver-oxc](https://www.npmjs.com/package/eslint-import-resolver-oxc) (powered by `oxc-resolver`), [eslint-import-resolver-next](https://www.npmjs.com/package/eslint-import-resolver-next) (also powered by `oxc-resolver`), or other similar resolvers.
55+
56+
### Patch Changes
57+
58+
- [#206](https://github.com/un-ts/eslint-plugin-import-x/pull/206) [`449738f`](https://github.com/un-ts/eslint-plugin-import-x/commit/449738f4f4b84ff24c2748cdc86185cff5840442) Thanks [@privatenumber](https://github.com/privatenumber)! - insert type prefix without new line
59+
360
## 4.5.1
461

562
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-import-x",
3-
"version": "4.5.1",
3+
"version": "4.6.0",
44
"description": "Import with sanity.",
55
"repository": "git+https://github.com/un-ts/eslint-plugin-import-x",
66
"author": "JounQin <admin@1stg.me> (https://www.1stG.me)",

0 commit comments

Comments
 (0)