eslint icon indicating copy to clipboard operation
eslint copied to clipboard

Bug: --inspect-config should always download the latest @eslint/config-inspector?

Open silvenon opened this issue 9 months ago • 4 comments

Environment

Node version: v20.13.1 npm version: v10.5.2 Local ESLint version: v9.2.0 (Currently used) Global ESLint version: Not found Operating System: darwin 23.5.0

What parser are you using?

Default (Espree)

What did you do?

Configuration
import eslint from "@eslint/js";

export default [
  eslint.configs.recommended,
];

I wanted to see my configuration, so I ran:

npx eslint --inspect-config

which I suppose runs npx @eslint/config-inspector.

What did you expect to happen?

I expected to see my configuration open in the browser.

What actually happened?

I got an error that my config wasn't found and that ESLint itself wasn't found. Running npx @eslint/config-inspector didn't help either.

However, what did fix the problem was running:

npx @eslint/config-inspector@latest

I first thought that this was because it installed a newer version of @eslint/config-inspector, but both versions of the inspector were v0.4.8.

So I'm not sure why this fixes my problem.

Link to Minimal Reproducible Example

https://github.com/silvenon/repro/tree/eslint-v9-inspect-config

Participation

  • [ ] I am willing to submit a pull request for this issue.

Additional comments

No response

silvenon avatar May 21 '24 16:05 silvenon

For future reference, should "ESLint Config Inspector" issues be posted to /eslint/eslint or /eslint/config-inspector?

Previously: CLI launches older release

erosman avatar May 22 '24 06:05 erosman

For future reference, should "ESLint Config Inspector" issues be post to /eslint/eslint or /eslint/config-inspector?

Previously: CLI launches older release

Usually to the /eslint/config-inspector repo, but this particular issue seems to be a problem with how eslint --inspect-config runs @eslint/config-inspector.

mdjermanovic avatar May 22 '24 06:05 mdjermanovic

I got an error that my config wasn't found and that ESLint itself wasn't found. Running npx @eslint/config-inspector didn't help either.

However, what did fix the problem was running:

npx @eslint/config-inspector@latest

I first thought that this was because it installed a newer version of @eslint/config-inspector, but both versions of the inspector were v0.4.8.

So I'm not sure why this fixes my problem.

Strange. We've now changed --inspect-config to run npx @eslint/config-inspector@latest, but we'll leave this issue open until we release this change (https://github.com/eslint/eslint/issues/18479) to see if it fixes the problem.

mdjermanovic avatar May 22 '24 07:05 mdjermanovic

Strange. We've now changed --inspect-config to run npx @eslint/config-inspector@latest

Yeah, I was also really surprised… anyway, thanks for picking this up so quickly!

silvenon avatar May 22 '24 14:05 silvenon