-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Please describe what the rule should do:
Disallows Class Fields added in ES2022.
https://github.com/estree/estree/blob/master/es2022.md
Provide 2-3 code examples that this rule will warn about:
https://github.com/tc39/proposal-class-fields
class Counter {
x = 0;
}
https://github.com/tc39/proposal-private-methods
class Counter {
#xValue = 0;
get #x() { return #xValue; }
set #x(value) {
this.#xValue = value;
window.requestAnimationFrame(this.#render.bind(this));
}
#clicked() {
this.#x++;
}
constructor() {
super();
this.onclick = this.#clicked.bind(this);
}
connectedCallback() { this.#render(); }
#render() {
this.textContent = this.#x.toString();
}
}
https://github.com/tc39/proposal-static-class-features
class CustomDate {
// ...
static epoch = new CustomDate(0);
}
export class JSDOM {
static async fromURL(url, options = {}) {
return JSDOM.#finalizeFactoryCreated(new JSDOM(body, options), "fromURL");
}
static #finalizeFactoryCreated(jsdom, factoryName) {
// ...
}
}
Metadata
Metadata
Assignees
Labels
No labels