diff --git a/src/generators/plugin.ts b/src/generators/plugin.ts index bbedb68a..b418c6fc 100644 --- a/src/generators/plugin.ts +++ b/src/generators/plugin.ts @@ -52,7 +52,12 @@ export default class Plugin extends Generator { type: 'input', name: 'name', message: 'Name (must start with plugin-)', - validate: (input: string): boolean => /plugin-[a-z]+$/.test(input), + validate: (input: string): boolean | string => { + const result = /plugin-[a-z]+$/.test(input); + if (result) return true; + + return 'Name must start with plugin- and be lowercase'; + }, when: (answers: { internal: boolean }): boolean => answers.internal, }, {