Skip to content

Support WeakRefs #13602

Closed
Closed
@mdjermanovic

Description

@mdjermanovic

WeakRefs proposal is now Stage 4.

https://github.com/tc39/proposal-weakrefs

(it seems the proposal's repo hasn't been updated yet with tc39/proposal-weakrefs#212, but it was official in tc39/proposals@489f6df and merged in the spec in tc39/ecma262@71c0897).

  • ESLint Update 1 (minor version)
  • ESLint Update 2 (major minor version):

Not sure if the new syntax label is appropriate since this isn't "syntax".

Activity

added
enhancementThis change enhances an existing feature of ESLint
ruleRelates to ESLint's core rules
coreRelates to ESLint's core APIs and features
acceptedThere is consensus among the team that this change meets the criteria for inclusion
new syntaxThis issue is related to new syntax that has reached stage 4
on Aug 21, 2020
mdjermanovic

mdjermanovic commented on Aug 24, 2020

@mdjermanovic
MemberAuthor

As for no-extend-native, this rule currently doesn't report any errors in the following code:

/* global FinalizationRegistry, WeakRef */

FinalizationRegistry.prototype.foo = bar;
WeakRef.prototype.foo = bar;

It will start reporting this code, but not before the next ESLint major version when we will upgrade the globals package to ^13 or above.

The same applies to a configuration where the new es2021 environment (which contains FinalizationRegistry and WeakRef) is enabled.

So, regardless of user configuration, the no-extend-native rule will not disallow modifying FinalizationRegistry and WeakRef prototypes until ESLint v8.0.0.

This is in line with a similar decision in #11803 for new BigInt globals, where it was seen as a breaking change, and thus postponed for v7.0.0 (though, for most users the change probably happened before v7.0.0, because globals added BigInt globals in a minor version of the package, and we have ^ dependency).

added a commit that references this issue on Aug 29, 2020
added
breakingThis change is backwards-incompatible
and removed
enhancementThis change enhances an existing feature of ESLint
on Sep 5, 2020
mdjermanovic

mdjermanovic commented on Sep 5, 2020

@mdjermanovic
MemberAuthor

Marked as breaking for Update 2: upgrading globals package, which would cause no-extend-native to report more errors.

self-assigned this
on Sep 5, 2020

4451 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussioncoreRelates to ESLint's core APIs and featuresnew syntaxThis issue is related to new syntax that has reached stage 4ruleRelates to ESLint's core rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Support WeakRefs · Issue #13602 · eslint/eslint