Open loilo opened 5 years ago
Need discussion, maybe it is not bad idea
This also sounds like it's out of scope. Prettier doesn't usually add code, right?
Prettier does not add semantics. It adds/removes/moves punctuation though and you could argue that a previously missing public
keyword is kind of that.
However, I could see this being perceived as kind of... encroaching, maybe.
This is not done with Prettier for TypeScript. Also, you could argue that automatically inserting the visibility could result in the developer forgetting to set the correct visibility (for example, they may have intended to make the property private).
I can't imagine someone doing that, but I certainly won't assume that my coding habits are representative.
But I agree that while this would not add semantics, it would make implicit semantics explicit which may be unintended/confusing/annoying.
PSR-12 Violations
Solving this would need an
--engine
flag.