We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cde5fa1 + fdd9ada commit 72a65c4Copy full SHA for 72a65c4
src/validate/index.ts
@@ -101,7 +101,7 @@ export default function validate(
101
throw error;
102
}
103
104
- if (name && !/^[A-Z]/.test(name)) {
+ if (name && /^[a-z]/.test(name)) {
105
const message = `options.name should be capitalised`;
106
onwarn({
107
message,
test/validator/index.js
@@ -88,4 +88,19 @@ describe("validate", () => {
88
89
]);
90
});
91
+
92
+ it("does not warn if options.name begins with non-alphabetic character", () => {
93
+ const warnings = [];
94
+ svelte.compile("<div></div>", {
95
+ name: "_",
96
+ onwarn(warning) {
97
+ warnings.push({
98
+ message: warning.message,
99
+ pos: warning.pos,
100
+ loc: warning.loc
+ });
+ }
+ assert.deepEqual(warnings, []);
0 commit comments