Skip to content

Commit ca03653

Browse files
committed
fixup! fix: do not wrongly suggest that a lang attribute is missing when finding comments
1 parent 69a2e0b commit ca03653

File tree

1 file changed

+4
-1
lines changed
  • packages/vite-plugin-svelte/src/utils

1 file changed

+4
-1
lines changed

packages/vite-plugin-svelte/src/utils/error.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,11 @@ export function enhanceCompileError(err, originalCode, preprocessors) {
132132

133133
let m;
134134
while ((m = styleRe.exec(originalCode))) {
135+
if (m[0]?.startsWith('<!--')) {
136+
continue;
137+
}
135138
// Warn missing lang attribute
136-
if (!m[0]?.startsWith('<!--') && !m[1]?.includes('lang=')) {
139+
if (!m[1]?.includes('lang=')) {
137140
additionalMessages.push('Did you forget to add a lang attribute to your style tag?');
138141
}
139142
// Warn missing style preprocessor

0 commit comments

Comments
 (0)