Skip JS globals for InlineComponent nodes in warn_if_undefined. (#4071)

pull/4084/head
Benjamin W. Broersma 5 years ago committed by Conduitry
parent 2c9d864e33
commit 3433418dce

@ -1283,7 +1283,7 @@ export default class Component {
if (this.var_lookup.has(name) && !this.var_lookup.get(name).global) return;
if (template_scope && template_scope.names.has(name)) return;
if (globals.has(name)) return;
if (globals.has(name) && node.type !== 'InlineComponent') return;
let message = `'${name}' is not defined`;
if (!this.ast.instance)

@ -0,0 +1,15 @@
[{
"code": "missing-declaration",
"message": "'String' is not defined. Consider adding a <script> block with 'export let String' to declare a prop",
"start": {
"line": 2,
"column": 1,
"character": 7
},
"end": {
"line": 2,
"column": 10,
"character": 16
},
"pos": 7
}]
Loading…
Cancel
Save