Skip to content

complete/no-private-identifiers

💼 This rule is enabled in the ✅ recommended config.

📝 Disallows # private members in favor of the TypeScript private modifier.

For TypeScript projects, using private instead of # is superior in a few ways. This blog goes into more detail.

// Bad
class Foo {
#value = 1;
#getValue() {
return this.#value;
}
}
// Good
class Foo {
private value = 1;
private getValue() {
return this.value;
}
}

This rule is not configurable.