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: Move ESLint Plugin before ESLint Core in CLI prompt #97

Merged
merged 1 commit into from Jul 9, 2021

Conversation

bmish
Copy link
Sponsor Member

@bmish bmish commented Jul 6, 2021

Since it's more common for consumers to use this for generating ESLint plugin rules than ESLint core rules. We want the more common usage to be the default (first).

In this CLI prompt:

yo eslint:rule
? What is your name? John Doe
? Where will this rule be published? (Use arrow keys)
❯ ESLint Plugin
  ESLint Core

Since it's more common for consumers to use this for generating ESLint plugin rules than ESLint core rules. We want the more common usage to be the default (first).

In this CLI prompt:

```
yo eslint:rule
? What is your name? John Doe
? Where will this rule be published? (Use arrow keys)
❯ ESLint Plugin
  ESLint Core
```
@aladdin-add
Copy link
Member

not sure why having the option. I think it's fine to just remove it, as users cannot publish eslint core?

@bmish
Copy link
Sponsor Member Author

bmish commented Jul 8, 2021

I assume it was originally intended for users who wanted to submit a pull request for a new rule to ESLint core. Maybe some people still want to use it for that? I don't feel strongly but I did want to make sure it was not the default behavior.

It's used to adjust the rule test import:

var rule = require("../../../lib/rules/<%= ruleId %>"),
<% if (target === "eslint") { %>
    RuleTester = require("../../../lib/testers/rule-tester");
<% } else { %>
    RuleTester = require("eslint").RuleTester;
<% } %>

@aladdin-add
Copy link
Member

highly likely to be. cc @nzakas

@nzakas
Copy link
Member

nzakas commented Jul 9, 2021

Yes, we wanted the generator to help people both write their own plugins as well as contribute to the core. Im fine with moving plugin first.

@aladdin-add aladdin-add merged commit a39c90f into eslint:main Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants