Let's assume we have two functions
/**
* @typedef MyResponse
* @property {Number} id - my awesome id
* @property {Array<Number>} attributes - list of ids
* */
/**
* @return {Promise<MyResponse>}
* */
function request0() {
return Promise.resolve({id: 1, attributes: [1,2,3]});
}
and
(async function () {
const { foo } = await request0(); // but it doesn't return foo, it returns id and attributes
console.log(foo);
})();
Is it possible to highlight somehow that kind of errors? I tried to find something on eslint but no luck.
Thanks