How to rewrite code to avoid TSLint “object access via string literals”
I'm pretty new to TypeScript and I would like to know if there exists a good way to rewrite code to avoid TSLint error "object access via string literals is disallowed" in the following code interface ECType { name: string; type: string; elementType?: string; } export var fields: { [structName: string]: Array<ECType>; } = { }; class ECStruct1 { foo: string; bar: number; baz: boolean; qux: number; quux: number; corge: ECStruct2[]; grault: ECStruct2; constructor() { ... } } fields['ECStruct1'] = [ { name: 'foo', type: 'string' }, { name: 'bar', type: 'int' }, { name: 'baz', type: 'bool' }, {