mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 05:51:21 +08:00
19 lines
667 B
TypeScript
19 lines
667 B
TypeScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import { logger } from '@storybook/node-logger';
|
|
import type { PluginOptions } from '../types';
|
|
|
|
const incompatiblePresets = ['@storybook/preset-scss', '@storybook/preset-typescript'];
|
|
|
|
export const checkPresets = (options: PluginOptions): void => {
|
|
const { presetsList } = options;
|
|
|
|
presetsList.forEach((preset: string | { name: string }) => {
|
|
const presetName = typeof preset === 'string' ? preset : preset.name;
|
|
if (incompatiblePresets.includes(presetName)) {
|
|
logger.warn(
|
|
`\`${presetName}\` may not be compatible with \`@storybook/preset-create-react-app\``
|
|
);
|
|
}
|
|
});
|
|
};
|