Skip to content

fix: also check the eslint-scope nested under the user's eslint - #312

Merged
ota-meshi merged 1 commit into
vuejs:masterfrom
ValentinYoushkevich:fix/eslint-scope-from-eslint
Nov 6, 2026
Merged

ota-meshi merged 1 commit into
vuejs:masterfrom
ValentinYoushkevich:fix/eslint-scope-from-eslint

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

When another package pins eslint-scope 8 at the root (e.g. javascript-obfuscator), npm dedupes this parser onto it while ESLint 10 gets its own 9.x, and linting any .vue file with <script setup> crashes:

TypeError: scopeManager.addGlobals is not a function
    at addDeclaredGlobals (eslint/lib/languages/js/source-code/source-code.js:261:15)
    at SourceCode.finalize (eslint/lib/languages/js/source-code/source-code.js:1136:3)

Repro: ESLint Online Playground

getEslintScope() only compared its own dependency with the copy resolved from the cwd. It now also checks the copy resolved from the user's eslint and still picks the newest.

fix #308

@ota-meshi ota-meshi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thank you!
Also, thank you for explaining how to reproduce the issue!

@ota-meshi
ota-meshi merged commit bdee6f0 into vuejs:master Nov 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

With ESLint 10, an eslint-scope 8 resolved for the parser crashes linting (scopeManager.addGlobals is not a function)

2 participants