Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions code/lib/cli/src/generators/baseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ const hasFrameworkTemplates = (framework?: SupportedFrameworks) =>
export async function baseGenerator(
packageManager: JsPackageManager,
npmOptions: NpmOptions,
{ language, builder = CoreBuilder.Webpack5, pnp, frameworkPreviewParts }: GeneratorOptions,
{
language,
builder = CoreBuilder.Webpack5,
pnp,
frameworkPreviewParts,
yes: skipPrompts,
}: GeneratorOptions,
renderer: SupportedRenderers,
options: FrameworkOptions = defaultOptions,
framework?: SupportedFrameworks
Expand Down Expand Up @@ -358,8 +364,7 @@ export async function baseGenerator(
);

if (hasEslint && !isStorybookPluginInstalled) {
const shouldInstallESLintPlugin = await suggestESLintPlugin();
if (shouldInstallESLintPlugin) {
if (skipPrompts || (await suggestESLintPlugin())) {

@chakAs3 chakAs3 May 20, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is almost what i did. to bpass the prompts, however we agreed, we still need to fix this issue.

depsToInstall.push('eslint-plugin-storybook');
await configureEslintPlugin(eslintConfigFile, packageManager);
}
Expand Down
2 changes: 2 additions & 0 deletions code/lib/cli/src/generators/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type GeneratorOptions = {
linkable: boolean;
pnp: boolean;
frameworkPreviewParts?: FrameworkPreviewParts;
// skip prompting the user
yes: boolean;
};

export interface FrameworkOptions {
Expand Down
1 change: 1 addition & 0 deletions code/lib/cli/src/initiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const installStorybook = async <Project extends ProjectType>(
builder: options.builder || (await detectBuilder(packageManager, projectType)),
linkable: !!options.linkable,
pnp: pnp || options.usePnp,
yes: options.yes,
};

const runGenerator: () => Promise<any> = async () => {
Expand Down
Loading