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

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

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

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

Loading…
Cancel
Save