aurelia / template-lint

Sanity check of Aurelia-flavor template HTML
Apache License 2.0
56 stars 17 forks source link

Support type alias #179

Open InfiniteLukeOne opened 6 years ago

InfiniteLukeOne commented 6 years ago

Consider a view:

<template>
    <input value.bind="data.property1" />
    <input value.bind="data.property2" />
    <input value.bind="data.property3" />
</template>

and a view model:

type Alias = {
    property1: string;
    property2: string;
};

export class ViewModel {
    data: Alias = {
        property1: 'test',
        property2: ''
    };
}

aurelia-template-lint currently ignores the non existing property3.

If the type alias in the view model is changed to an interface, a warning is correctly thrown:

interface Alias {
    property1: string;
    property2: string;
}

export class ViewModel {
    data: Alias = {
        property1: 'test',
        property2: ''
    };
}