diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 171d2a354c..427ff5eb08 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -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` }); } diff --git a/test/validator/samples/component-name-lowercase/input.svelte b/test/validator/samples/component-name-lowercase/input.svelte index e531235f70..ebd7cf3481 100644 --- a/test/validator/samples/component-name-lowercase/input.svelte +++ b/test/validator/samples/component-name-lowercase/input.svelte @@ -1,6 +1,6 @@ diff --git a/test/validator/samples/component-name-lowercase/warnings.json b/test/validator/samples/component-name-lowercase/warnings.json index 7d0d29391d..37765b423d 100644 --- a/test/validator/samples/component-name-lowercase/warnings.json +++ b/test/validator/samples/component-name-lowercase/warnings.json @@ -1,15 +1,15 @@ [ { - "code": "lowercase-component-name", - "message": "A lowercase tag will be treated as a regular HTML element", - "pos": 84, + "code": "component-name-lowercase", + "message": " 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 }