From c5da7003c3e98400be91fb2c38a988fbe3dab124 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:55:16 +0800 Subject: [PATCH] chore: release eslint-import-resolver-typescript (#327) Co-authored-by: github-actions[bot] --- .changeset/metal-insects-trade.md | 45 ------------------------------ CHANGELOG.md | 46 +++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 .changeset/metal-insects-trade.md diff --git a/.changeset/metal-insects-trade.md b/.changeset/metal-insects-trade.md deleted file mode 100644 index 0598ccf..0000000 --- a/.changeset/metal-insects-trade.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -'eslint-import-resolver-typescript': minor ---- - -This version has implemented the `eslint-plugin-import-x`'s v3 resolver interface. This allows you to use import/require to reference `eslint-import-resolver-typescript` directly in your ESLint flat config: - -**Previously** - -```js -// eslint.config.js -module.exports = { - settings: { - 'import-x/resolver': { - typescript: { - alwaysTryTypes: true, - }, - // or - require.resolve('eslint-import-resolver-typescript'): - alwaysTryTypes: true, - } - } - } -} -``` - -**Now** - -```js -// eslint.config.js -const { - createTypeScriptImportResolver, -} = require('eslint-import-resolver-typescript') - -module.exports = { - settings: { - 'import-x/resolver-next': [ - createTypeScriptImportResolver({ - alwaysTryTypes: true, - }), - ], - }, -} -``` - -Note that this only works with `eslint-plugin-import-x@>=4.5.0`. You can't use `createTypeScriptImportResolver` with the older versions of `eslint-plugin-import-x` or any existing versions of `eslint-plugin-import`. diff --git a/CHANGELOG.md b/CHANGELOG.md index 957ada7..fcf2dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,51 @@ # Changelog +## 3.7.0 + +### Minor Changes + +- [#326](https://github.com/import-js/eslint-import-resolver-typescript/pull/326) [`93ea130`](https://github.com/import-js/eslint-import-resolver-typescript/commit/93ea1305d0317db62a71edf029688eb410c2d261) Thanks [@SukkaW](https://github.com/SukkaW)! - This version has implemented the `eslint-plugin-import-x`'s v3 resolver interface. This allows you to use import/require to reference `eslint-import-resolver-typescript` directly in your ESLint flat config: + + **Previously** + + ```js + // eslint.config.js + module.exports = { + settings: { + 'import-x/resolver': { + typescript: { + alwaysTryTypes: true, + }, + // or + require.resolve('eslint-import-resolver-typescript'): + alwaysTryTypes: true, + } + } + } + } + ``` + + **Now** + + ```js + // eslint.config.js + const { + createTypeScriptImportResolver, + } = require('eslint-import-resolver-typescript') + + module.exports = { + settings: { + 'import-x/resolver-next': [ + createTypeScriptImportResolver({ + alwaysTryTypes: true, + }), + ], + }, + } + ``` + + Note that this only works with `eslint-plugin-import-x@>=4.5.0`. You can't use `createTypeScriptImportResolver` with the older versions of `eslint-plugin-import-x` or any existing versions of `eslint-plugin-import`. + ## 3.6.3 ### Patch Changes diff --git a/package.json b/package.json index ee3c7b3..2bc41b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-import-resolver-typescript", - "version": "3.6.3", + "version": "3.7.0", "type": "module", "description": "This plugin adds `TypeScript` support to `eslint-plugin-import`", "repository": "git+https://github.com/import-js/eslint-import-resolver-typescript",