eslint / eslint

Find and fix problems in your JavaScript code.
https://eslint.org
MIT License
24.39k stars 4.4k forks source link

Bug: npm init @eslint/config generates broken-by-default config file #18358

Closed ChristopherJTrent closed 1 month ago

ChristopherJTrent commented 1 month ago

Environment

Node version: 21.6.2 npm version: 10.5.2 Local ESLint version: 9.0.0 Global ESLint version: 9.0.0 Operating System: Arch Linux

Node and npm installed using asdf v0.14.0

What parser are you using?

Default (Espree)

What did you do?

I ran npm init @eslint/config and followed the prompts to create a configuration file

What did you expect to happen?

I expected it to generate a valid eslint 9 configuration file

What actually happened?

it generated a non-eslint 9 compatible config file

Link to Minimal Reproducible Example

https://github.com/ChristopherJTrent/eslint_example

Participation

Additional comments

No response

Rec0iL99 commented 1 month ago

Hi @ChristopherJTrent, can you try running npm init @eslint/config@latest? My guess is that you are using an old version of the create-config utility. Using @latest will fetch the latest version from npm.

ChristopherJTrent commented 1 month ago

So, that generates a valid config file, but installs ESLint 8 as a dependency for all of the available templates