Skip to content

Issue a warning when referencing a missing property #31

@fabiomoriero

Description

@fabiomoriero

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions