I was wondering if there is a TSLint rule with which I can disallow the following code:
var arr = [1, 2];
//the line below should be disallowed
arr.prop1 = "3";
//because arr now has array elements and object properties
I want to disallow this because it prevents arr from being fully serialized with JSON.stringify, because JSON.stringify will serialize arr into [1, 2].
I have looked at the TSLint rules but wasn't able to find a rule for this.