mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
chore(scripts): fix lints
This commit is contained in:
parent
5d02a13525
commit
de0ff76c8f
2 changed files with 6 additions and 6 deletions
|
@ -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"));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue