eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
699 stars 18 forks source link

Does Not Run with Bun #102

Open Barzi-Ahmed opened 6 days ago

Barzi-Ahmed commented 6 days ago

Hi,

I use Bun for my project, and when I try to use "bun x eslint --inspect-config" or "bun x --bun eslint --inspect-config", it doesn't work and shows this error message:

$ eslint --inspect-config
You can also run this command directly using 'npx @eslint/config-inspector@latest' in the same directory as your configuration file.
'npx' is not recognized as an internal or external command,
operable program or batch file.

Please support Bun.

voxpelli commented 6 days ago

All the info you need is there in the message that’s printed?

As it say: eslint --inspect-config is simply a shortcut within eslint that runs npx @eslint/config-inspector

Since you’re on Bun the npx command fails. Do what the command recommends and do the Bun equivalent of npx @eslint/config-inspector directly instead of using the shortcut.

If you do want to file an issue about adding support for Bun in the shortcut, then you would have to file it towards the main ESLint project, not the config inspector.

Barzi-Ahmed commented 6 days ago

@voxpelli ,

I did exactly that now, I get this error:

C:\Users\Blackberry\Desktop\monorepo\packages\web>bun x @eslint/config-inspector
22 | for (const key of Reflect.ownKeys(fs.Dirent.prototype)) {
23 |     const name = key;
24 |     if (name === 'constructor') {
25 |         continue;
26 |     }
27 |     DirentFromStats.prototype[name] = function () {
                         ^
TypeError: Attempted to assign to readonly property.
      at C:\Users\Blackberry\AppData\Local\Temp\bunx-1157896195-@eslint\config-inspector@latest\node_modules\@nodelib\fs.scandir\out\utils\fs.js:27:21
      at C:\Users\Blackberry\AppData\Local\Temp\bunx-1157896195-@eslint\config-inspector@latest\node_modules\@nodelib\fs.scandir\out\utils\index.js:4:9
      at C:\Users\Blackberry\AppData\Local\Temp\bunx-1157896195-@eslint\config-inspector@latest\node_modules\@nodelib\fs.scandir\out\providers\async.js:6:7
      at C:\Users\Blackberry\AppData\Local\Temp\bunx-1157896195-@eslint\config-inspector@latest\node_modules\@nodelib\fs.scandir\out\scandir.js:5:7
      at C:\Users\Blackberry\AppData\Local\Temp\bunx-1157896195-@eslint\config-inspector@latest\node_modules\@nodelib\fs.scandir\out\index.js:4:5

Bun v1.1.33 (Windows x64)