chore(scripts): fix lints

This commit is contained in:
Eric Liu 2025-03-30 09:08:20 -07:00
commit de0ff76c8f
2 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@ sveld({
},
});
globSync(["./src/**/*.d.ts"]).forEach((file) => {
for (const file of globSync(["./src/**/*.d.ts"])) {
console.log("Copying", file, " to types/");
fs.copyFileSync(file, file.replace(/src/, "types"));
});
}

View file

@ -15,7 +15,7 @@ const formatTypeScript = async (value) => {
console.time("formatComponentApi");
let modified = { ...componentApi };
const modified = { ...componentApi };
modified.components = await Promise.all(
componentApi.components.map(async (component) => {
@ -26,7 +26,7 @@ modified.components = await Promise.all(
}
let normalizedValue = prop.value;
let prefix = `const ${prop.name} = `;
const prefix = `const ${prop.name} = `;
if (prop.isFunction || prop.value.startsWith("{")) {
normalizedValue = prefix + prop.value;
@ -64,7 +64,7 @@ modified.components = await Promise.all(
return event;
}
let normalizedValue = `type EventDetail = ` + event.detail;
const normalizedValue = `type EventDetail = ${event.detail}`;
const formatted = (await formatTypeScript(normalizedValue))
// Remove prefix needed for formatting.
@ -88,7 +88,7 @@ modified.components = await Promise.all(
let normalizedValue = slot.slot_props;
if (normalizedValue.startsWith("{")) {
normalizedValue = `type SlotProps = ` + normalizedValue;
normalizedValue = `type SlotProps = ${normalizedValue}`;
}
const formatted = (await formatTypeScript(normalizedValue))