eslint / generator-eslint

A Yeoman generator to help with ESLint development
Other
228 stars 51 forks source link

Update: Move `ESLint Plugin` before `ESLint Core` in CLI prompt #97

Closed bmish closed 3 years ago

bmish commented 3 years ago

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 commented 3 years ago

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

bmish commented 3 years ago

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 commented 3 years ago

highly likely to be. cc @nzakas

nzakas commented 3 years ago

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.