pull/5302/head
Conduitry 5 years ago
parent 7e7bc17164
commit 1f677c5152

@ -186,7 +186,7 @@ export default class Element extends Node {
case 'Attribute': case 'Attribute':
case 'Spread': case 'Spread':
// special case // special case
if (node.name === 'xmlns') this.namespace = node.value[0].data; if (node.name === 'xmlns') this.namespace = node.value[0].data;
this.attributes.push(new Attribute(component, this, scope, node)); this.attributes.push(new Attribute(component, this, scope, node));
@ -243,8 +243,8 @@ export default class Element extends Node {
validate() { validate() {
if (this.component.var_lookup.has(this.name) && this.component.var_lookup.get(this.name).imported) { if (this.component.var_lookup.has(this.name) && this.component.var_lookup.get(this.name).imported) {
this.component.warn(this, { this.component.warn(this, {
code: 'lowercase-component-name', code: 'component-name-lowercase',
message: `A lowercase tag <${this.name}> will be treated as a regular HTML element` message: `<${this.name}> will be treated as an HTML element unless it begins with a capital letter`
}); });
} }

@ -1,6 +1,6 @@
<script> <script>
import thisShouldWarnMe from './MyComponent.svelte'; import thisShouldWarnMe from './MyComponent.svelte';
let i; let i;
</script> </script>
<thisShouldWarnMe /> <thisShouldWarnMe />

@ -1,15 +1,15 @@
[ [
{ {
"code": "lowercase-component-name", "code": "component-name-lowercase",
"message": "A lowercase tag <thisShouldWarnMe> will be treated as a regular HTML element", "message": "<thisShouldWarnMe> will be treated as an HTML element unless it begins with a capital letter",
"pos": 84, "pos": 82,
"start": { "start": {
"character": 84, "character": 82,
"column": 0, "column": 0,
"line": 6 "line": 6
}, },
"end": { "end": {
"character": 104, "character": 102,
"column": 20, "column": 20,
"line": 6 "line": 6
} }

Loading…
Cancel
Save