eslint-plugin-es icon indicating copy to clipboard operation
eslint-plugin-es copied to clipboard

New Rule Proposal: `no-private-fields-in-in`

Open ota-meshi opened this issue 3 years ago • 0 comments

Please describe what the rule should do:

Disallows #x in obj syntax added in ES2022.

https://github.com/tc39/proposal-private-fields-in-in

Provide 2-3 code examples that this rule will warn about:

class C {
  #brand;

  static isC(obj) {
    return #brand in obj; // <-
  }
}

ota-meshi avatar Jul 20 '21 00:07 ota-meshi