Repository navigation
ESLint: Allow 'Use with caution' components in all of Storybook - #87535
Merged
Merged
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.73 MB
|
simison
marked this pull request as ready for review
November 27, 2026 09:39
simison
force-pushed
the
simison/eslint-storybook-recommended-components
branch
from
November 27, 2026 14:30
40ec5c4 to
7650b9e
Compare
ciampo
approved these changes
Nov 27, 2026
Vedant-Gandhi
pushed a commit
to Vedant-Gandhi/gutenberg
that referenced
this pull request
Nov 30, 2026
…Press#87535) Co-authored-by: simison <simison@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Gives all of Storybook (
storybook/**) its own@wordpress/use-recommended-componentsoverride intools/eslint/config.mjs.Before, only
storybook/stories/**was covered, and the rule was turned off there. Now Storybook runs it withallowUseWithCaution: trueinstead.packages/components/**keeps the rule off.Why?
Suggested in #86918 (comment): anything in Storybook can reasonably opt in to newer components early. This replaces adding Storybook subdirectories (such as
storybook/components/**) to the override one at a time.Earlier disabling the rule mixed two concerns: using new components early, and not using deprecated ones.
With
allowUseWithCaution: true, Storybook can use "Use with caution" components while deprecated imports are still flagged, unlike before.A story that imports a
@wordpress/uicomponent marked "Not recommended" is still flagged. This happened when the original override was added in #76463, before the "Use with caution" tier existed. If it comes up, an inlineeslint-disable-next-lineon that import seems fine.Testing Instructions
npm run lint:js -- tools/eslint/config.mjs storybookpasses (taken care by CI)import { TextControl } from '@wordpress/components';to any file understorybook/stories/, then runnpm run lint:json that file. Confirm it reports@wordpress/use-recommended-components.