Skip to content

Optional properties inherited from interface not detected #178

@gronostajo

Description

@gronostajo

Here's an example:

model.ts

export interface Entity {
    pending?: boolean; // note the question mark!
}

export class Language implements Entity {
    name: string;
}

app.ts

import {Language} from "./model";

export class App {
    languages: Language[];

    constructor() {
        this.languages = [
            {name: 'foo'},
            {name: 'bar', pending: false},
            {name: 'baz', pending: true},
        ];
    }
}

app.html

<template>
    <h1>Hello world!</h1>
    <ul>
        <li repeat.for="language of languages">
            ${language.name}
            <button type="button" disabled.bind="language.pending">choose</button>
        </li>
    </ul>
</template>

Results of linting via gulp-aurelia-template-lint:

[12:27:20] WARNING: cannot find 'pending' in type 'Language' Ln 6 Col 13 \src\app.html

Here's the code in an app, complete with gulp and gulp-aurelia-template-lint: gronostajo/aurelia-template-lint-bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions