Skip to content

Commit

Permalink
Merge pull request #25289 from storybookjs/shilman/remove-eslint-prompt
Browse files Browse the repository at this point in the history
CLI: Never prompt for ESLint plugin
  • Loading branch information
shilman authored Jan 8, 2024
2 parents be9c746 + c1edba0 commit 4335bf3
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions code/lib/cli/src/generators/baseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ import { getPackageDetails } from '../js-package-manager';
import { getBabelPresets, writeBabelConfigFile } from '../babel-config';
import packageVersions from '../versions';
import type { FrameworkOptions, GeneratorOptions } from './types';
import {
configureEslintPlugin,
extractEslintInfo,
suggestESLintPlugin,
} from '../automigrate/helpers/eslintPlugin';
import { configureEslintPlugin, extractEslintInfo } from '../automigrate/helpers/eslintPlugin';
import { detectBuilder } from '../detect';

const logger = console;
Expand Down Expand Up @@ -175,14 +171,7 @@ const hasFrameworkTemplates = (framework?: SupportedFrameworks) =>
export async function baseGenerator(
packageManager: JsPackageManager,
npmOptions: NpmOptions,
{
language,
builder,
pnp,
frameworkPreviewParts,
yes: skipPrompts,
projectType,
}: GeneratorOptions,
{ language, builder, pnp, frameworkPreviewParts, projectType }: GeneratorOptions,
renderer: SupportedRenderers,
options: FrameworkOptions = defaultOptions,
framework?: SupportedFrameworks
Expand Down Expand Up @@ -360,10 +349,8 @@ export async function baseGenerator(
);

if (hasEslint && !isStorybookPluginInstalled) {
if (skipPrompts || (await suggestESLintPlugin())) {
depsToInstall.push('eslint-plugin-storybook');
await configureEslintPlugin(eslintConfigFile ?? undefined, packageManager);
}
depsToInstall.push('eslint-plugin-storybook');
await configureEslintPlugin(eslintConfigFile ?? undefined, packageManager);
}
}
} catch (err) {
Expand Down

0 comments on commit 4335bf3

Please sign in to comment.