template-lint
template-lint copied to clipboard
repeat.for should check if it gets an iterable collection
class TestViewModel {
value: number;
nullableCollection: string[] | undefined;
}
<template>
<template repeat.for="item of value">${item}</template> <!-- should warn -->
<template repeat.for="item of nullableCollection">${item}</template> <!-- should warn -->
<template if.bind="nullableCollection">
<template repeat.for="item of nullableCollection">${item}</template> <!-- ok -->
</template>
</template>