Skip to content

ESLint-plugin: Fix csf-strict extends resolution after bundling#34750

Open
ShebangDog wants to merge 2 commits into
storybookjs:nextfrom
ShebangDog:fix/csf-strict-extends-path
Open

ESLint-plugin: Fix csf-strict extends resolution after bundling#34750
ShebangDog wants to merge 2 commits into
storybookjs:nextfrom
ShebangDog:fix/csf-strict-extends-path

Conversation

@ShebangDog
Copy link
Copy Markdown

@ShebangDog ShebangDog commented May 8, 2026

Closes #

What I did

The csf-strict config was using a relative path (./configs/csf) to extend the csf config. This path is relative to the source directory structure, but after bundling the file ends up at the package root — causing the extends resolution to fail at runtime.

Changed the extends path to use the plugin format (plugin:storybook/csf), which resolves correctly regardless of where the bundled file is located.

  • scripts/update-lib-configs.ts: Fixed the template that generates legacy configs
  • src/configs/csf-strict.ts: Applied the fix via yarn update-rules

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Tested with a local project (csf-plugin-demo) that uses plugin:storybook/csf-strict:

Confirmation steps

  1. In csf-plugin-demo: run npm run lint → fails (cannot resolve ./configs/csf)
  2. In code/lib/eslint-plugin/: run yalc publish to publish the fixed package locally
  3. In csf-plugin-demo: run yalc add eslint-plugin-storybook@10.4.0-alpha.17 to install the fixed version
  4. In csf-plugin-demo: run npm run lint → succeeds

Error

Error in Confirmation steps 1

npm run lint

> my-app@0.1.0 lint
> eslint .


Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "./configs/csf" to extend from. Please check that the name of the config is correct.

The config "./configs/csf" was referenced from the config file in "/Users/<hoge>/Projects/typescript/my-app/node_modules/eslint-plugin-storybook/dist/index.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Refactor
    • Updated ESLint configuration references to use plugin-based preset notation instead of relative file paths. This improves configuration maintainability while preserving all existing linting behavior and rules.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 141730fb-c666-415d-b891-17cf40f7d159

📥 Commits

Reviewing files that changed from the base of the PR and between 245043f and a394d2b.

📒 Files selected for processing (2)
  • code/lib/eslint-plugin/scripts/update-lib-configs.ts
  • code/lib/eslint-plugin/src/configs/csf-strict.ts

📝 Walkthrough

Walkthrough

The PR updates ESLint plugin configuration extends references from relative file paths to plugin notation format. The config file csf-strict.ts and the generator script update-lib-configs.ts both switch to using plugin:storybook/* identifiers instead of ./configs/* relative paths.

Changes

ESLint Plugin Config Extends Format

Layer / File(s) Summary
Config Extends Format
code/lib/eslint-plugin/src/configs/csf-strict.ts
Default exported config extends changed from ./configs/csf to plugin:storybook/csf.
Generator Script Pattern
code/lib/eslint-plugin/scripts/update-lib-configs.ts
Config generation logic updated to output plugin-based extends entries using plugin:storybook/${extendsCategoryId} format instead of relative paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • storybookjs/storybook#31963: Modifies the same csf-strict config and generator scripts; related PR also updates config file overrides for story file scoping.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ShebangDog ShebangDog changed the title Chore(legacy/csf-strict): do 'update-all' script ESLint-plugin: Fix csf-strict extends resolution after bundling May 8, 2026
@valentinpalkovic valentinpalkovic moved this to Empathy Queue (prioritized) in Core Team Projects May 11, 2026
@github-actions github-actions Bot added the Stale label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Empathy Queue (prioritized)

Development

Successfully merging this pull request may close these issues.

2 participants