tslint-immutable
tslint-immutable copied to clipboard
TSLint rules to disable mutation in TypeScript.
This will be cool addition to https://github.com/jonaskello/tslint-immutable#no-mixed-interface or as standalone rule I think. Even better to allow functions only in interfaces and data only in type literals
Using `Readonly` is much more readable than marking every property as `readonly`.
See [Travis build](https://travis-ci.com/jonaskello/tslint-immutable/builds/116048100) for details.
Within constructors, class member initialization and mutation seem to be treated as the same thing. Only initialization should be allowed. ```ts class Foo { readonly bar = 1; readonly baz:...
Today we can ignore prefix on interface members using `readonly-keyword` with `ignore-prefix`. Sometimes (for performance reasons) I would like to create an interface where all members are mutable. In those...
Are there any compile-time performance costs to have `readonly` everywhere? The whole project and idea sounds super legit to me, but I'm afraid to automatically convert my whole codebase to...
The point of `"ignore-local"` is that you still have a pure function, even if you have local state. But in `readonly-array`, even local interface definitions are ignored, even if they...
There is an escape hatch for mutable members of an interface by prefixing them. However this is not useful for indexer interfaces. So I propose to extend the prefix to...