tylasu icon indicating copy to clipboard operation
tylasu copied to clipboard

Issue a warning when referencing a missing property

Open fabiomoriero opened this issue 2 years ago • 1 comments
trafficstars

In transformers, when a reference to a missing property is met, undefined is returned. It would be useful to have a warning, in order to, e.g., catch typos.

const sourcePropName : string | undefined = Object.keys(src).find(e => e == elem);

if (!sourcePropName) {
    // TODO: issue a warning "reference to a missing property"
    // new Issue(
    //     IssueType.SEMANTIC,
    //     `A missing property has been referenced: ${elem} in ${src} (class: ${Object.getPrototypeOf(src).constructor.name})`,
    //     IssueSeverity.WARNING
    // )
    return undefined;
}

fabiomoriero avatar Jan 05 '23 09:01 fabiomoriero

I've looked into this issue and from what I've seen it looks like it's not present anymore. I'm not sure though if there was just a change of shape in code, and so if the need is still there, somewhere else, I would need a bit of guidance on this issue if you think it's still relevant.

Anyway, looks like the change was introduced here, on Jan 4, 2023 which matches this issue's creation date.

This change removed that code.

lazywithclass avatar Jul 20 '24 14:07 lazywithclass