Skip to content

Commit

Permalink
New: Include XO style guide in eslint --init (#14193)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Apr 29, 2021
1 parent 8a77b66 commit 0b6a3f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/init/config-initializer.js
Expand Up @@ -531,7 +531,8 @@ function promptUser() {
choices: [
{ message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" },
{ message: "Standard: https://github.com/standard/standard", name: "standard" },
{ message: "Google: https://github.com/google/eslint-config-google", name: "google" }
{ message: "Google: https://github.com/google/eslint-config-google", name: "google" },
{ message: "XO: https://github.com/xojs/eslint-config-xo", name: "xo" }
],
skip() {
this.state.answers.packageJsonExists = npmUtils.checkPackageJson();
Expand Down
8 changes: 8 additions & 0 deletions tests/lib/init/config-initializer.js
Expand Up @@ -240,6 +240,14 @@ describe("configInitializer", () => {
assert.include(modules, "eslint-config-standard@latest");
});

it("should support the xo style guide", () => {
const config = { extends: "xo" };
const modules = init.getModulesList(config);

assert.deepStrictEqual(config, { extends: "xo", installedESLint: true });
assert.include(modules, "eslint-config-xo@latest");
});

it("should install required sharable config", () => {
const config = { extends: "google" };

Expand Down

0 comments on commit 0b6a3f3

Please sign in to comment.