mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-30 00:46:29 +01:00
Skip JS globals for InlineComponent nodes in warn_if_undefined. (#4071)
This commit is contained in:
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,3 @@
|
||||
<div>
|
||||
<String/>
|
||||
</div>
|
@ -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…
Reference in New Issue
Block a user