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
the property bar is readonly, but it is not immutable. To enforce immutability on the type level, it would have to be wrapped in a Readonly utility type like so:
interface Foo {
readonly bar: Readonly<Bar>;
}
The latter is most often the desired behaviour as showcase by #5971, for example.
I propose enforcing that all non-primitive types found next to the class/object/interface readonly properties are wrapped in the Readonly utility type.
An example of one possible implementation of this rule can be found at #6006
The text was updated successfully, but these errors were encountered:
This issue captures the 2nd part of the work identified in the following conversation https://nomicfoundation.slack.com/?redir=%2Farchives%2FC03P6B72ZHU%2Fp1732272638933179%3Fname%3DC03P6B72ZHU%26perma%3D1732272638933179. I think it might make the most sense to add it to the backlog for now.
In the following snippet:
the property
bar
is readonly, but it is not immutable. To enforce immutability on the type level, it would have to be wrapped in aReadonly
utility type like so:The latter is most often the desired behaviour as showcase by #5971, for example.
I propose enforcing that all non-primitive types found next to the class/object/interface readonly properties are wrapped in the
Readonly
utility type.An example of one possible implementation of this rule can be found at #6006
The text was updated successfully, but these errors were encountered: