create-config icon indicating copy to clipboard operation
create-config copied to clipboard

package manager (npm, yarn, etc.) is not asked in style (How would you like to use ESLint) option

Open HiteshTheGreatest opened this issue 1 year ago • 5 comments

Two questions (that is install the deps and what package manager) are skipped when choose to style options.

HiteshTheGreatest avatar Feb 24 '24 17:02 HiteshTheGreatest

Hello @hitesh-can-code, could you please provide more details about what you mean by 'style options'?

Rec0iL99 avatar Feb 25 '24 06:02 Rec0iL99

image eslint need to ask what package manager first than checking peersdeps

HiteshTheGreatest avatar Feb 25 '24 06:02 HiteshTheGreatest

I couldn't reproduce this on my local machine

> bun create @eslint/config                                                                                                                                                                                            
✔ How would you like to use ESLint? · style
✔ What type of modules does your project use? · esm
✔ Which framework does your project use? · none
✔ Does your project use TypeScript? · No / Yes
✔ Where does your code run? · node
✔ How would you like to define a style for your project? · guide
✔ Which style guide do you want to follow? · standard-with-typescript
✔ What format do you want your config file to be in? · JSON
Checking peerDependencies of eslint-config-standard-with-typescript@latest
The config that you've selected requires the following dependencies:

eslint-config-standard-with-typescript@latest @typescript-eslint/eslint-plugin@^6.4.0 eslint@^8.0.1 eslint-plugin-import@^2.25.2 eslint-plugin-n@^15.0.0 || ^16.0.0  eslint-plugin-promise@^6.0.0 typescript@*
✔ Would you like to install them now? · No / Yes
? Which package manager do you want to use? … 
❯ npm
  yarn
  pnpm

I'm getting the option to choose which package manager.

> bun --version                                                                                                                                                                                                        
1.0.29

Did I miss something?

Rec0iL99 avatar Feb 26 '24 05:02 Rec0iL99

it is because you have npm installed where i only have bun

HiteshTheGreatest avatar Feb 26 '24 11:02 HiteshTheGreatest

it was not using npm to install any dependencies, it was to check the package's peer dependencies: https://github.com/eslint/create-config/blob/9c4214bc879cc892fd8ba4f1259c7d0686b0d7c2/lib/init/npm-utils.js#L71-L75

for no-npm-installed envs, we could find another way to do it.

aladdin-add avatar Feb 29 '24 06:02 aladdin-add