This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
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.
This PR adds new
"class-static-block"
scopes. EachStaticBlock
node creates a"class-static-block"
scope.https://github.com/tc39/proposal-class-static-block
Notes:
arguments
. However, referencing thosearguments
is a parse-time error, so I didn't add those variables to class static block scopes because they have no observable effects. This is consistent with class field initializers, we didn't addarguments
there either.Scope#isThisMaterialized
, is not updated."class-static-block"
type could be to use the existing"function"
type, which might be more practical for some use cases, but also confusing for others. I think it's better to introduce a new scope type.I tagged this as a breaking change as I'd like to suggest that we bump major version. While this is a new syntax for
eslint-scope
, parsers (including Espree) already support this syntax, and inserting a new scope where it didn't exist before looks like a relatively big change in scope analysis (from wrong to right, but still).