Fix ESLint 10 compatibility in eslint-plugin-storybook rules#33884
Draft
Fix ESLint 10 compatibility in eslint-plugin-storybook rules#33884
Conversation
…precated alternatives Co-authored-by: valentinpalkovic <5889929+valentinpalkovic@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix crash under ESLint 10 support
Fix ESLint 10 compatibility in eslint-plugin-storybook rules
Feb 20, 2026
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.
ESLint 10 removed several deprecated
contextmethods, causing runtime crashes (TypeError: context.getSourceCode is not a function) in multipleeslint-plugin-storybookrules.Changes
Replaced removed
contextmethods with their direct property equivalents across 5 rules:context.getSourceCode()context.sourceCodecontext.getFilename()context.filenameAffected rules:
meta-satisfies-typeno-title-property-in-metause-storybook-testing-librarydefault-exportsprefer-pascal-caseBoth replacements were introduced in ESLint 8.25–8.40, so this is backward-compatible with ESLint 8, 9, and 10. The
prefer-pascal-caserule already usedcontext.sourceCodefor scope handling — this change makes the rest of the codebase consistent.Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]: eslint 10 support</issue_title>
<issue_description>### Describe the bug
Summary
storybook/meta-satisfies-typecrashes under ESLint 10.0.0.Error
TypeError: context.getSourceCode is not a functionExpected behavior
Rule should execute without runtime errors on ESLint 10.
Environment
Workaround
Rule currently disabled.
Reproduction link
n/a
Reproduction steps
System
Additional context
No response</issue_description>
<agent_instructions>Make sure to support Eslint 9 as well.
Here is the migration guide:
Migrate to v10.x
ESLint v10.0.0 is a major release of ESLint, and as such, has several breaking changes that you need to be aware of. This guide is intended to walk you through the breaking changes.
The lists below are ordered roughly by the number of users each change is expected to affect, where the first items are expected to affect the most users.
Table of Contents
Breaking changes for users
Node.js < v20.19, v21, v23 are no longer supported
eslint:recommended has been updated
New configuration file lookup algorithm
Old config format no longer supported
JSX references are now tracked
eslint-env comments are reported as errors
Jiti < v2.2.0 are no longer supported
POSIX character classes in glob patterns
stylish formatter now uses native styleText instead of chalk
Deprecated options of the radix rule
no-shadow-restricted-names now reports globalThis by default
func-names schema is stricter
allowConstructorFlags option of no-invalid-regexp now accepts only unique items
name property added to ESLint core configs
Breaking changes for plugin developers
Node.js < v20.19, v21, v23 are no longer supported
Old config format no longer supported
JSX references are now tracked
Removal of type property in errors of invalid RuleTester cases
Program AST node range spans entire source text
Fixer methods now require string text arguments
New requirements for ScopeManager implementations
Removal of deprecated context members
Removal of deprecated SourceCode methods
Prohibiting errors or output of valid RuleTester test cases
POSIX character classes in glob patterns
Breaking changes for integration developers
Node.js < v20.19, v21, v23 are no longer supported
New configuration file lookup algorithm
Old config format no longer supported
Removal of nodeType property in LintMessage objects
POSIX character classes in glob patterns
Node.js < v20.19, v21, v23 are no longer supported
ESLint is officially dropping support for these versions of Node.js starting with ESLint v10.0.0. ESLint now supports the following versions of Node.js:
Node.js v20.19.0 and above
Node.js v22.13.0 and above
Node.js v24 and above
To address: Make sure you upgrade to at least Node.js v20.19.0 when using ESLint v10.0.0. One important thing to double check is the Node.js version supported by your editor when using ESLint via editor integrations. If you are unable to upgrade, we recommend continuing to use ESLint v9 until you are able to upgrade Node.js.
Related issue(s): #19969
eslint:recommended has been updated
Three new rules have been enabled in eslint:recommended:
no-unassigned-vars
no-useless-assignment
preserve-caught-error
To address: Fix errors or disable these rules.
Related issue(s): #19966
New configuration file lookup algorithm
In ESLint v9, the alternate config lookup behavior could be enabled with the v10_config_lookup_from_file feature flag. This behavior made ESLint locate eslint.config.* by starting from the directory of each linted file and searching up towards the filesystem root. In ESLint v10.0.0, this behavior is now the...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.