Skip to content

Commit

Permalink
feat: remove ts style guides
Browse files Browse the repository at this point in the history
fixes #101
  • Loading branch information
aladdin-add committed Apr 18, 2024
1 parent dbd8742 commit e81bbba
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/config-generator.js
Expand Up @@ -17,10 +17,6 @@ const jsStyleGuides = [
{ message: "Standard: https://github.com/standard/standard", name: "standard", value: { packageName: "eslint-config-standard", type: "eslintrc" } },
{ message: "XO: https://github.com/xojs/eslint-config-xo", name: "xo", value: { packageName: "eslint-config-xo", type: "eslintrc" } }
];
const tsStyleGuides = [
{ message: "Standard: https://github.com/standard/eslint-config-standard-with-typescript", name: "standard", value: { packageName: "eslint-config-standard-with-typescript", type: "eslintrc" } },
{ message: "XO: https://github.com/xojs/eslint-config-xo-typescript", name: "xo", value: { packageName: "eslint-config-xo-typescript", type: "eslintrc" } }
];

/**
* Class representing a ConfigGenerator.
Expand Down Expand Up @@ -92,7 +88,10 @@ export class ConfigGenerator {
{ message: "No", name: "javascript" },
{ message: "Yes", name: "typescript" }
],
initial: 0
initial: 0,
skip() {
return this.state.answers.purpose === "style";
}
},
{
type: "multiselect",
Expand All @@ -113,13 +112,12 @@ export class ConfigGenerator {

if (answers.purpose === "style") {

const choices = this.answers.language === "javascript" ? jsStyleGuides : tsStyleGuides;
const styleguideAnswer = await enquirer.prompt({
type: "select",
name: "styleguide",
message: "Which style guide do you want to follow?",
choices,
result: choice => choices.find(it => it.name === choice).value
choices: jsStyleGuides,
result: choice => jsStyleGuides.find(it => it.name === choice).value
});

Object.assign(this.answers, styleguideAnswer);
Expand Down

0 comments on commit e81bbba

Please sign in to comment.