The scopes are not necessarily represented in the AST, like that's a concept, it's not part of the syntax. And so we actually do scope analysis as part of running the ESLint on a file as well. A rule can say, okay, give me the scope that's related to this particular node. That scope then contains things like variable declarations, variable references, and stuff like that that you can use to implement that no shadow rule that you mentioned.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode