Skip to content

Commit 0b6a3f3

Browse files
authored
New: Include XO style guide in eslint --init (#14193)
1 parent 8a77b66 commit 0b6a3f3

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/init/config-initializer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ function promptUser() {
531531
choices: [
532532
{ message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" },
533533
{ message: "Standard: https://github.com/standard/standard", name: "standard" },
534-
{ message: "Google: https://github.com/google/eslint-config-google", name: "google" }
534+
{ message: "Google: https://github.com/google/eslint-config-google", name: "google" },
535+
{ message: "XO: https://github.com/xojs/eslint-config-xo", name: "xo" }
535536
],
536537
skip() {
537538
this.state.answers.packageJsonExists = npmUtils.checkPackageJson();

tests/lib/init/config-initializer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ describe("configInitializer", () => {
240240
assert.include(modules, "eslint-config-standard@latest");
241241
});
242242

243+
it("should support the xo style guide", () => {
244+
const config = { extends: "xo" };
245+
const modules = init.getModulesList(config);
246+
247+
assert.deepStrictEqual(config, { extends: "xo", installedESLint: true });
248+
assert.include(modules, "eslint-config-xo@latest");
249+
});
250+
243251
it("should install required sharable config", () => {
244252
const config = { extends: "google" };
245253

0 commit comments

Comments
 (0)