Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
silvenon opened this issue May 21, 2024 · 5 comments · Fixed by #18483
Open
1 task

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

silvenon opened this issue May 21, 2024 · 5 comments · Fixed by #18483
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly

Comments

@silvenon
Copy link
Contributor

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 silvenon added bug ESLint is working incorrectly repro:needed labels May 21, 2024
aladdin-add added a commit to aladdin-add/eslint that referenced this issue May 22, 2024
like @eslint/create-config (eslint#18369), it may use
an outdated version, this commit forces to use latest version.

fixes eslint#18481
aladdin-add added a commit to aladdin-add/eslint that referenced this issue May 22, 2024
like @eslint/create-config (eslint#18369), it may use
an outdated version, this commit forces to use the latest version.

fixes eslint#18481
@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion and removed repro:needed labels May 22, 2024
@erosman
Copy link

erosman commented May 22, 2024

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

Previously:
CLI launches older release

@mdjermanovic
Copy link
Member

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 added a commit that referenced this issue May 22, 2024
* fix: use `@eslint/config-inspector@latest`

like @eslint/create-config (#18369), it may use
an outdated version, this commit forces to use the latest version.

fixes #18481

* Update docs/src/use/command-line-interface.md

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

---------

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@mdjermanovic
Copy link
Member

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 (#18479) to see if it fixes the problem.

@silvenon
Copy link
Contributor Author

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!

@mdjermanovic
Copy link
Member

I wanted to see my configuration, so I ran:

npx eslint --inspect-config

@silvenon can you please try again with ESLint v9.4.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

4 participants