Skip to content

ESLint: Update deprecated @storybook/test reference to storybook/test#34430

Merged
valentinpalkovic merged 2 commits into
storybookjs:nextfrom
venkat22022202:fix/eslint-deprecated-storybook-test
Apr 27, 2026
Merged

ESLint: Update deprecated @storybook/test reference to storybook/test#34430
valentinpalkovic merged 2 commits into
storybookjs:nextfrom
venkat22022202:fix/eslint-deprecated-storybook-test

Conversation

@venkat22022202
Copy link
Copy Markdown
Contributor

@venkat22022202 venkat22022202 commented Apr 1, 2026

Summary

Fixes #34422

The use-storybook-testing-library ESLint rule was suggesting imports from @storybook/test in its error message, and auto-fixing to @storybook/testing-library — both of which are deprecated in Storybook v10. The correct import path is storybook/test (per the official docs).

Fix

  • Updated the error message to suggest storybook/test instead of @storybook/test / @storybook/testing-library
  • Updated the auto-fix to rewrite imports to storybook/test instead of @storybook/testing-library
  • Updated the suggestion fix to use storybook/test
  • Updated corresponding test expectations

Test plan

  • ESLint rule should now suggest storybook/test instead of @storybook/test
  • Auto-fix should rewrite imports to use storybook/test
  • All existing test cases updated to reflect the new import path

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated ESLint rule to align Storybook testing library import guidance with the new standard. The rule now directs developers to import from storybook/test rather than @storybook/testing-library. Error messages and auto-fix suggestions were updated to guide users toward the correct import path.

…orybook/test

The `use-storybook-testing-library` ESLint rule was suggesting imports from
`@storybook/test` and auto-fixing to `@storybook/testing-library`, both of which
are deprecated in Storybook v10. Updated the error message, auto-fix, and
suggestion fix to use `storybook/test` instead.

Fixes storybookjs#34422

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

Great change, thanks for your contribution!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

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: 40a88819-1ffd-4c73-805b-0141e9b91cb4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ffc041 and 9499c59.

📒 Files selected for processing (2)
  • code/lib/eslint-plugin/src/rules/use-storybook-testing-library.test.ts
  • code/lib/eslint-plugin/src/rules/use-storybook-testing-library.ts

📝 Walkthrough

Walkthrough

Updates the ESLint plugin rule use-storybook-testing-library to use Storybook's new import source storybook/test instead of @storybook/testing-library. Changes include updating the rule's message text, auto-fix logic, test fixtures, and suggested import replacements.

Changes

Cohort / File(s) Summary
ESLint Rule Import Migration
code/lib/eslint-plugin/src/rules/use-storybook-testing-library.ts, code/lib/eslint-plugin/src/rules/use-storybook-testing-library.test.ts
Updated rule message, fixer, and test fixtures to replace @storybook/testing-library with storybook/test as the canonical import source for within and userEvent. Valid test cases now import from storybook/test, and invalid cases expect suggestions/outputs with the new import source.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs


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.

@yannbf yannbf changed the title fix(eslint-plugin): update deprecated @storybook/test reference to storybook/test ESLint: Update deprecated @storybook/test reference to storybook/test Apr 1, 2026
@yannbf yannbf added bug patch:yes Bugfix & documentation PR that need to be picked to main branch ci:normal eslint-plugin labels Apr 1, 2026
@github-actions github-actions Bot added the Stale label Apr 27, 2026
@valentinpalkovic valentinpalkovic merged commit 77ff820 into storybookjs:next Apr 27, 2026
114 checks passed
@valentinpalkovic valentinpalkovic moved this from Done to Empathy Queue (prioritized) in Core Team Projects Apr 27, 2026
@valentinpalkovic valentinpalkovic moved this from Empathy Queue (prioritized) to Done in Core Team Projects Apr 27, 2026
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:normal eslint-plugin patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch Stale

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: ESLint plugin recommends deprecated package

3 participants