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

Include XO style guide in eslint --init #14193

Merged
merged 1 commit into from Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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