Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue a warning when referencing a missing property #31

Open
fabiomoriero opened this issue Jan 5, 2023 · 1 comment
Open

Issue a warning when referencing a missing property #31

fabiomoriero opened this issue Jan 5, 2023 · 1 comment

Comments

@fabiomoriero
Copy link
Contributor

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;
}
@lazywithclass
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants