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

feat: added yarn and pnpm installations #24

Merged
merged 5 commits into from Mar 29, 2022

Conversation

harish-sethuraman
Copy link
Member

Added yarn and pnpm for installing dependencies

I've used eslint/eslint#13756 as base for this PR and added pnpm. I once tried to link create-config with eslint and things seemed to work fine with yarn berry version too.

fixes: #20

@nzakas
Copy link
Member

nzakas commented Mar 26, 2022

Looks like we have some test failures.

@harish-sethuraman
Copy link
Member Author

Will check

@aladdin-add
Copy link
Member

I've re-run the ci, and it's ✅. 🎉

@aladdin-add aladdin-add self-requested a review March 28, 2022 05:51
type: "select",
name: "packageManager",
message: "Which package manager does your project use?",
initial: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering if it can be a smarter default by checking how it was run. e.g

`npm init/npx`  => npm
`yarn create` => yarn

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably do that by checking if we already have an existing package.lock or yarn.lock or pnpm lock file and default to package managers.
Also, we might want to change the text to Which package manager do you want to use?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but someone may don't use lockfile, or the lockfile can be configured a different name?

the text change lgtm. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought of using something similar to this code eslint/eslint#13756 (comment)

but someone may don't use lockfile, or the lockfile can be configured a different name?

Not sure about this

Is there any other way to find currently configured package manager?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea.(^人^)
or it can be another PR (an enhancement) I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Also I've seen some projects with both package.lock and yarn.lock as well. At that time we might want to default to one of the two package managers 😅 .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think there’s a good way to detect this. Just best to ask.

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

type: "select",
name: "packageManager",
message: "Which package manager does your project use?",
initial: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think there’s a good way to detect this. Just best to ask.

lib/init/npm-utils.js Outdated Show resolved Hide resolved
lib/init/config-initializer.js Outdated Show resolved Hide resolved
@nzakas nzakas merged commit 8a26ef4 into eslint:main Mar 29, 2022
@harish-sethuraman harish-sethuraman deleted the add-yarn-pnpm branch March 29, 2022 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Yarn and pnpm support in eslint --init
3 participants