Skip to content

Commit fef84bc

Browse files
authored
fix: only respect built-in tools from CLI argv (#75)
1 parent d7188b4 commit fef84bc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export type Argv = {
8383
'package-name'?: string;
8484
};
8585

86+
const BUILTIN_TOOLS = ['eslint', 'prettier', 'biome'];
87+
8688
function logHelpMessage(name: string, templates: string[]) {
8789
logger.log(`
8890
Usage: create-${name} [dir] [options]
@@ -104,7 +106,9 @@ function logHelpMessage(name: string, templates: string[]) {
104106

105107
async function getTools({ tools, dir, template }: Argv) {
106108
if (tools) {
107-
return Array.isArray(tools) ? tools : [tools];
109+
let toolsArr = Array.isArray(tools) ? tools : [tools];
110+
toolsArr = toolsArr.filter((tool) => BUILTIN_TOOLS.includes(tool));
111+
return toolsArr;
108112
}
109113
// skip tools selection when using CLI options
110114
if (dir && template) {

0 commit comments

Comments
 (0)