-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Description
Describe the bug
When initializing Storybook in a Next.js project, the setup modifies the eslint.config file to include an import for the Storybook ESLint plugin, but does not actually register the plugin in the ESLint configuration array.
Current generated eslint.config:
// 👇 only the import is added, but the plugin isn't added to the config
import storybook from "eslint-plugin-storybook";
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);
export default eslintConfig;Expected behaviour
Storybook’s init process should both:
- Add the eslint-plugin-storybook import and
- Extend the ESLint configuration with the Storybook plugin, e.g.:
Reproduction steps
- Create a new Next.js project (
npx gitpick storybookjs/sandboxes/tree/next/nextjs-vite/default-ts/before-storybook) - Run
npx storybook@latest init - Inspect the generated eslint.config.mjs (or eslint.config.mjs)
System
-Additional context
No response
dosubotCopilot