Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run lint check #2070

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions docs/src/COMPONENT_API.json
Original file line number Diff line number Diff line change
Expand Up @@ -3235,10 +3235,7 @@
"ts": "interface DataTableCell<\n Row = DataTableRow,\n> {\n key:\n | DataTableKey<Row>\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"
Expand Down Expand Up @@ -18066,4 +18063,4 @@
}
}
]
}
}
30 changes: 18 additions & 12 deletions docs/src/components/ComponentApi.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
</script>

Expand Down Expand Up @@ -116,20 +116,20 @@
>
<svelte:component
this={AsyncPreviewTypeScript}
type="inline"
code={typeMap[type]}
/>
</div>
type="inline"
code={typeMap[type]}
/>
</div>
{:else}
<div
style="display: inline-flex; max-width: 220px; word-break: break-word;"
>
<svelte:component
this={AsyncPreviewTypeScript}
type="inline"
code={type}
/>
</div>
type="inline"
code={type}
/>
</div>
{/if}
</div>
{/each}
Expand All @@ -145,10 +145,16 @@
</div>
{/each}
{/if}
<div style:margin-top="var(--cds-layout-02)" style:margin-bottom="var(--cds-spacing-03)">
<div
style:margin-top="var(--cds-layout-02)"
style:margin-bottom="var(--cds-spacing-03)"
>
<strong>Default value</strong>
</div>
<div style:margin-bottom="var(--cds-layout-01)" style:max-width="85%">
<div
style:margin-bottom="var(--cds-layout-01)"
style:max-width="85%"
>
{#if prop.value === undefined}
<em>undefined</em>
{:else}
Expand Down
6 changes: 3 additions & 3 deletions scripts/format-component-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
};

Expand Down