From 1ea66d81c87f746e0f4ecc71cbb17ef1dccdd2c4 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Tue, 25 Mar 2025 11:29:02 +0100 Subject: [PATCH 1/5] Document `bun` option --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 24c81041..95a509a6 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ export default [ createTypeScriptImportResolver({ alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + bun: true, // resolve Bun modules, defaults to false + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default // use /path/to/folder/tsconfig.json @@ -136,6 +138,8 @@ export default [ typescript: { alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + bun: true, // resolve Bun modules, defaults to false + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default // use /path/to/folder/tsconfig.json @@ -186,6 +190,8 @@ Add the following to your `.eslintrc` config: "typescript": { "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + "bun": true, // resolve Bun modules, defaults to false + // Choose from one of the "project" configs below or omit to use /tsconfig.json by default // use /path/to/folder/tsconfig.json From c0e3ce25b92fcfb68108309acd35e8964e499511 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Tue, 25 Mar 2025 17:18:44 +0100 Subject: [PATCH 2/5] Add Bun environment setup instructions to README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 95a509a6..def1490a 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,18 @@ Add the following to your `.eslintrc` config: } ``` +### Other environments + +#### Bun + +[Bun](https://bun.sh/) provides builtin modules such as `bun:test`, which are not resolved by default. + +Enable Bun builtin module resolution by choosing one of these 3 options: + +- Set the `bun: true` option, as shown in [Configuration](#configuration) above +- Run ESLint with `bun --bun eslint` +- [Configure `run.bun` in `bunfig.toml`](https://bun.sh/docs/runtime/bunfig#run-bun-auto-alias-node-to-bun) + ## Options from [`rspack-resolver`][] ### `conditionNames` From 29e410e97794312a7b9e07e6d599e4d59dec3837 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Tue, 25 Mar 2025 17:20:02 +0100 Subject: [PATCH 3/5] Add TOC links --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index def1490a..d58fb436 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ This means you can: - [Configuration](#configuration) - [`eslint.config.js`](#eslintconfigjs) - [`.eslintrc`](#eslintrc) + - [Other environments](#other-environments) + - [Bun](#bun) - [Options from `rspack-resolver`](#options-from-rspack-resolver) - [`conditionNames`](#conditionnames) - [`extensions`](#extensions) From 881b7dba41e7ca8d167983c8b939648395c4818a Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Tue, 25 Mar 2025 17:26:47 +0100 Subject: [PATCH 4/5] Change "builtin" to "built-in" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d58fb436..9fefb461 100644 --- a/README.md +++ b/README.md @@ -228,9 +228,9 @@ Add the following to your `.eslintrc` config: #### Bun -[Bun](https://bun.sh/) provides builtin modules such as `bun:test`, which are not resolved by default. +[Bun](https://bun.sh/) provides built-in modules such as `bun:test`, which are not resolved by default. -Enable Bun builtin module resolution by choosing one of these 3 options: +Enable Bun built-in module resolution by choosing one of these 3 options: - Set the `bun: true` option, as shown in [Configuration](#configuration) above - Run ESLint with `bun --bun eslint` From d86965d3a6f18a492a95b6d4cb7d1171984d94a8 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Tue, 25 Mar 2025 17:34:10 +0100 Subject: [PATCH 5/5] Link to Bun section --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9fefb461..4a4605b7 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ export default [ createTypeScriptImportResolver({ alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - bun: true, // resolve Bun modules, defaults to false + bun: true, // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun // Choose from one of the "project" configs below or omit to use /tsconfig.json by default @@ -140,7 +140,7 @@ export default [ typescript: { alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - bun: true, // resolve Bun modules, defaults to false + bun: true, // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun // Choose from one of the "project" configs below or omit to use /tsconfig.json by default @@ -192,7 +192,7 @@ Add the following to your `.eslintrc` config: "typescript": { "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - "bun": true, // resolve Bun modules, defaults to false + "bun": true, // resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun // Choose from one of the "project" configs below or omit to use /tsconfig.json by default @@ -230,7 +230,7 @@ Add the following to your `.eslintrc` config: [Bun](https://bun.sh/) provides built-in modules such as `bun:test`, which are not resolved by default. -Enable Bun built-in module resolution by choosing one of these 3 options: +Enable Bun built-in module resolution by choosing 1 out of these 3 options: - Set the `bun: true` option, as shown in [Configuration](#configuration) above - Run ESLint with `bun --bun eslint`