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

Update: separate eslint --init #79

Merged
merged 11 commits into from
Jun 10, 2021

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented May 4, 2021

rendered: https://github.com/aladdin-add/rfcs/tree/init-command-eslint-cli/designs/2021-init-command-eslint-cli

Summary

  • Move the init command from main repo (eslint) to a new repo named @eslint/create-config.
  • Remove the auto-config.

Related Issues

this is following #58

@aladdin-add aladdin-add force-pushed the init-command-eslint-cli branch from 86b7924 to a8643eb Compare May 5, 2021 00:23
@nzakas nzakas changed the title Docs: separate eslint --init Update: separate eslint --init May 5, 2021
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.

Thanks for picking this up. Just a few details to address.

designs/2021-init-command-eslint-cli/README.md Outdated Show resolved Hide resolved
designs/2021-init-command-eslint-cli/README.md Outdated Show resolved Hide resolved
designs/2021-init-command-eslint-cli/README.md Outdated Show resolved Hide resolved
designs/2021-init-command-eslint-cli/README.md Outdated Show resolved Hide resolved
@nzakas nzakas added Initial Commenting This RFC is in the initial feedback stage and removed triage labels May 5, 2021
@aladdin-add aladdin-add requested a review from nzakas May 6, 2021 13:48
@eslint/eslintrc will not be removed.
@aladdin-add aladdin-add force-pushed the init-command-eslint-cli branch 2 times, most recently from 58193e4 to 2010343 Compare May 20, 2021 09:39
@aladdin-add aladdin-add force-pushed the init-command-eslint-cli branch from 2010343 to 15f573d Compare May 20, 2021 09:45
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.

I think we have a good idea about the direction of this now. Thanks for finishing it up.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

This looks like enough to guide the implementation in the right direction. Thanks!

@nzakas
Copy link
Member

nzakas commented May 27, 2021

Moving to final commenting.

@nzakas nzakas added Final Commenting This RFC is in the final week of commenting and removed Initial Commenting This RFC is in the initial feedback stage labels May 27, 2021
- the following dependencies can be removed in eslint repo:
- enquirer
- semver
- Whenever `--init` command is being used, show a warning(e.g. "You can also run this command directly using 'npm init @eslint/config'") and run `npm init @eslint/config` using `child_process` of the native node modules.
Copy link
Member

Choose a reason for hiding this comment

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

Can we just show the message and let the user run the command manually?

One of the obstacles for supporting yarn in eslint --init (eslint/eslint#13756) was a scenario where the config initialization reinstalls local eslint, and then yarn intentionally breaks the whole process.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 good point! will update later.

Copy link
Member

Choose a reason for hiding this comment

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

Let's wait for more opinions first. @nzakas, @btmills what do you think about this?

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't that issue only apply when using yarn? If we run npm init @eslint/config, aren't we okay?

Copy link
Member Author

@aladdin-add aladdin-add Jun 7, 2021

Choose a reason for hiding this comment

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

It will be an issue when users are using some different package managers than npm(yarn/pnpm/...).

Copy link
Member Author

Choose a reason for hiding this comment

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

that also works. though I think better to recommend yarn users run yarn create @eslint/config. :)

Copy link
Member

Choose a reason for hiding this comment

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

@eslint/create-config will require() local ESLint to format the .eslintrc.js config file. Since yarn 2 doesn't create node_modules, I think that @eslint/create-config when run through npm init won't be able to require() any locally installed packages.

Copy link
Member

Choose a reason for hiding this comment

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

To add to my previous comment, eslint --init doesn't officially support yarn yet, but yarn eslint --init currently works fine when provided answers don't require installing dependencies. I'd expect the formatting step to fail when user runs yarn eslint --init and then we run npm init @eslint/config as a child process.

Copy link
Member

Choose a reason for hiding this comment

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

Given that we are in final commenting and there’s a lot of “I think” comments that are best answered by implementing the package and testing it, I move that we approve this RFC and hold further speculation until there is a prototype to play with.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. We'll certainly publish the new package first, and then we can experiment.

@nzakas
Copy link
Member

nzakas commented Jun 10, 2021

There is consensus on moving forward, so it’s time to merge!

@nzakas nzakas merged commit 69bf627 into eslint:main Jun 10, 2021
@aladdin-add aladdin-add deleted the init-command-eslint-cli branch July 5, 2021 07:27
aladdin-add added a commit to aladdin-add/rfcs that referenced this pull request Jul 12, 2022
* Docs: separate eslint --init

* chore: review suggestions

* chore: review suggestions

* chore: review suggestions

* chore: review suggestions

* Update README.md

@eslint/eslintrc will not be removed.

* chore: review suggestions

* Update designs/2021-init-command-eslint-cli/README.md

Co-authored-by: Nicholas C. Zakas <[email protected]>

* Update README.md

* Update designs/2021-init-command-eslint-cli/README.md

Co-authored-by: Milos Djermanovic <[email protected]>

* chore: rm unused deps

Co-authored-by: Nicholas C. Zakas <[email protected]>
Co-authored-by: Milos Djermanovic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Commenting This RFC is in the final week of commenting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants