warn on missing component (#623)

pull/628/head
Rich Harris 8 years ago
parent 6eb80e3732
commit d45699db6f

@ -6,6 +6,11 @@ export default function validateElement(validator: Validator, node: Node) {
const isComponent =
node.name === ':Self' || validator.components.has(node.name);
if (!isComponent && node.name[0] === node.name[0].toUpperCase()) {
// TODO upgrade to validator.error in v2
validator.warn(`${node.name} component is not defined`, node.start);
}
let hasIntro: boolean;
let hasOutro: boolean;
let hasTransition: boolean;

@ -0,0 +1,8 @@
[{
"message": "Widget component is not defined",
"loc": {
"line": 2,
"column": 1
},
"pos": 7
}]
Loading…
Cancel
Save