diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9f9b6c62e0..df91e1b935 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -17,6 +17,9 @@ jobs: - name: Install dependencies run: npm install + - name: Run lint + run: npm run lint + - name: Unit tests run: npm run test diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index c6ceb31d19..469dea2d09 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -3235,10 +3235,7 @@ "ts": "interface DataTableCell<\n Row = DataTableRow,\n> {\n key:\n | DataTableKey\n | (string & {});\n value: DataTableValue;\n display?: (\n item: DataTableValue,\n row: DataTableRow,\n ) => DataTableValue;\n}\n" } ], - "generics": [ - "Row", - "Row extends DataTableRow = DataTableRow" - ], + "generics": ["Row", "Row extends DataTableRow = DataTableRow"], "rest_props": { "type": "Element", "name": "div" @@ -18066,4 +18063,4 @@ } } ] -} \ No newline at end of file +} diff --git a/docs/src/components/ComponentApi.svelte b/docs/src/components/ComponentApi.svelte index 54dd1cd301..d819418677 100644 --- a/docs/src/components/ComponentApi.svelte +++ b/docs/src/components/ComponentApi.svelte @@ -39,10 +39,10 @@ $: source = `https://github.com/carbon-design-system/carbon-components-svelte/tree/master/${component.filePath}`; $: forwarded_events = component.events.filter( - (event) => event.type === "forwarded" + (event) => event.type === "forwarded", ); $: dispatched_events = component.events.filter( - (event) => event.type === "dispatched" + (event) => event.type === "dispatched", ); @@ -116,20 +116,20 @@ > - + type="inline" + code={typeMap[type]} + /> + {:else}
-
+ type="inline" + code={type} + /> + {/if} {/each} @@ -145,10 +145,16 @@ {/each} {/if} -
+
Default value
-
+
{#if prop.value === undefined} undefined {:else} diff --git a/scripts/format-component-api.js b/scripts/format-component-api.js index 537d3a3b77..ddf8bdafcf 100644 --- a/scripts/format-component-api.js +++ b/scripts/format-component-api.js @@ -5,11 +5,11 @@ import { format } from "prettier"; import plugin from "prettier/plugins/typescript"; const formatTypeScript = async (value) => { - return await format(value, { - parser: "typescript", + return await format(value, { + parser: "typescript", plugins: [plugin], printWidth: 40, // Force breaking onto new lines - bracketSameLine: false + bracketSameLine: false, }); };