Typescript 当解构对象时,tslint给出错误:(声明前不使用)

Typescript 当解构对象时,tslint给出错误:(声明前不使用),typescript,destructuring,Typescript,Destructuring,嗨,我有一个非常简单的对象,我正在分解它,但是tslint给出了一个奇怪的错误: 错误:(声明前不使用)声明前使用的变量“id”这与我尝试更改名称的所有属性相同 const { currency, id: brandId } = <{ id: string, currency: string }>result; const{currency,id:brandId}=result;

嗨,我有一个非常简单的对象,我正在分解它,但是tslint给出了一个奇怪的错误:

错误:(声明前不使用)声明前使用的变量“id”
这与我尝试更改名称的所有属性相同

const { currency, id: brandId } = <{ id: string, currency: string }>result;
const{currency,id:brandId}=result;