You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We agreed not to require public on constructors. We decided to prefer turning off enforcement (to avoid churn) rather than enforcing that there should be no modifier.
@rajsite to own turning this decision into a config change.
# Rationale
Resolves#100. Constructors may now be marked `public`, `private`, or
have no accessibility modifier. Previously they had to be marked
`public` or `private`.
# Implementation
Set `overrides: { constructors: 'off' }` in the TS rule configuration.
# Testing
Added a constructor to the TypeScript test and verified the rule
previously errored if it didn't have a modifier but now allows this.
@typescript-eslint/explicit-member-accessibility by default is forcing us to add
public
before every constructor, even though 99.9% of the time the implicit public is expected.We could set
[ { overrides: { constructors: 'no-public' } } ]
to change this: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md#disallow-the-use-of-public-on-a-given-memberThe text was updated successfully, but these errors were encountered: