Renaming from the IDE is not safe if the renamed variable is used to initialize an object with the ES6 property value shorthand syntax.
Example:
interface IFoo {
foo: string
}
const foo = "hello"; // <- rename foo into foo1
const bar: IFoo = { foo };
if on the IDE I rename foo into foo1 (at line 4), then the code will break because bar now has a property named foo1 which does not exist in its interface:
const bar: IFoo = { foo1 };
Ideally the IDE should be smart enough and modify the code in:
const bar: IFoo = { foo: foo1 };
Renaming from the IDE is not safe if the renamed variable is used to initialize an object with the ES6 property value shorthand syntax.
Example:
if on the IDE I rename
foointofoo1(at line 4), then the code will break becausebarnow has a property namedfoo1which does not exist in its interface:Ideally the IDE should be smart enough and modify the code in: