diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts
index 6636c6b87b..9ebef8d6e8 100644
--- a/src/compiler/compile/nodes/Element.ts
+++ b/src/compiler/compile/nodes/Element.ts
@@ -239,6 +239,13 @@ export default class Element extends Node {
}
validate() {
+ if (this.component.var_lookup.has(this.name) || this.scope.names.has(this.name)) {
+ this.component.warn(this, {
+ code: 'lowercase-component-name',
+ message: `A lowercase tag <${this.name}> will be treated as a regular HTML element`,
+ });
+ }
+
if (a11y_distracting_elements.has(this.name)) {
// no-distracting-elements
this.component.warn(this, {
diff --git a/test/validator/samples/component-name-lowercase-2/input.svelte b/test/validator/samples/component-name-lowercase-2/input.svelte
new file mode 100644
index 0000000000..8905895f52
--- /dev/null
+++ b/test/validator/samples/component-name-lowercase-2/input.svelte
@@ -0,0 +1,6 @@
+
+{#each array as item}
+
+{/each}
\ No newline at end of file
diff --git a/test/validator/samples/component-name-lowercase-2/warnings.json b/test/validator/samples/component-name-lowercase-2/warnings.json
new file mode 100644
index 0000000000..1b589d48d1
--- /dev/null
+++ b/test/validator/samples/component-name-lowercase-2/warnings.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "lowercase-component-name",
+ "end": {
+ "character": 64,
+ "column": 10,
+ "line": 5
+ },
+ "message": "A lowercase tag - will be treated as a regular HTML element",
+ "pos": 56,
+ "start": {
+ "character": 56,
+ "column": 2,
+ "line": 5
+ }
+ }
+]
diff --git a/test/validator/samples/component-name-lowercase/input.svelte b/test/validator/samples/component-name-lowercase/input.svelte
new file mode 100644
index 0000000000..d54f096eac
--- /dev/null
+++ b/test/validator/samples/component-name-lowercase/input.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/validator/samples/component-name-lowercase/warnings.json b/test/validator/samples/component-name-lowercase/warnings.json
new file mode 100644
index 0000000000..a4eb74c9db
--- /dev/null
+++ b/test/validator/samples/component-name-lowercase/warnings.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "lowercase-component-name",
+ "message": "A lowercase tag will be treated as a regular HTML element",
+ "pos": 75,
+ "end": {
+ "character": 95,
+ "column": 20,
+ "line": 5
+ },
+ "start": {
+ "character": 75,
+ "column": 0,
+ "line": 5
+ }
+ }
+]