Skip to content

Commit 03fdd1e

Browse files
committed
style: prettier the tsdoc
1 parent a737739 commit 03fdd1e

31 files changed

Lines changed: 1070 additions & 187 deletions

package-lock.json

Lines changed: 636 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"devDependencies": {
1919
"concurrently": "^9.2.1",
20-
"prettier": "3.7.4"
20+
"prettier": "3.7.4",
21+
"prettier-plugin-jsdoc": "1.8.0"
2122
},
2223
"repository": {
2324
"type": "git",
@@ -33,5 +34,13 @@
3334
"workspaces/core",
3435
"workspaces/react",
3536
"workspaces/website"
36-
]
37+
],
38+
"prettier": {
39+
"plugins": [
40+
"prettier-plugin-jsdoc"
41+
],
42+
"tsdoc": true,
43+
"jsdocSeparateTagGroups": true,
44+
"jsdocPreferCodeFences": true
45+
}
3746
}

workspaces/core/scripts/generate-banner.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/**
2-
* @fileoverview Generates the banner SCSS file with the current version.
3-
*/
1+
/** @file Generates the banner SCSS file with the current version. */
42

53
import { readFileSync, writeFileSync } from "fs";
64

workspaces/core/scss/components/_dialog.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@use "../theme/base" as *;
22

33
/*
4-
* Card
4+
* Dialog
55
*/
66
.#{$shale}dialog {
77
--#{$shale}dialog-transition-duration: 0.125s;

workspaces/core/scss/theme/_base.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ $indeterminate: ".#{$shale}-indeterminate" !default;
2929
--#{$shale}font-1: calc(var(--#{$shale}font-0) * var(--#{$shale}font-scale));
3030
--#{$shale}font-0: 1rem;
3131
--#{$shale}font--1: calc(var(--#{$shale}font-0) / var(--#{$shale}font-scale));
32-
--#{$shale}font--2: calc(var(--#{$shale}font--1) / var(--#{$shale}font-scale));
33-
--#{$shale}font--3: calc(var(--#{$shale}font--2) / var(--#{$shale}font-scale));
32+
--#{$shale}font--2: calc(
33+
var(--#{$shale}font--1) / var(--#{$shale}font-scale)
34+
);
35+
--#{$shale}font--3: calc(
36+
var(--#{$shale}font--2) / var(--#{$shale}font-scale)
37+
);
3438

3539
/* Shadows */
3640
--#{$shale}shadow-subtle: 0 2px 4px 0 rgba(0, 0, 0, 0.12);

workspaces/core/shalecss.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"use strict";
66

77
/**
8-
* toggles dark theme
8+
* Toggles dark theme
99
*
10-
* @param {Element} e element which has a .icon elem as a child
10+
* @param {Element} e Element which has a .icon elem as a child
1111
*/
1212
function toggleDark(e) {
1313
if (document.documentElement.classList.contains("shale-v1-dark")) {
@@ -22,9 +22,9 @@ function toggleDark(e) {
2222
}
2323

2424
/**
25-
* toggles contrast theme
25+
* Toggles contrast theme
2626
*
27-
* @param {Element} e element which has a .icon elem as a child
27+
* @param {Element} e Element which has a .icon elem as a child
2828
*/
2929
function toggleContrast(e) {
3030
if (document.documentElement.classList.contains("shale-v1-contrast")) {
@@ -39,9 +39,9 @@ function toggleContrast(e) {
3939
}
4040

4141
/**
42-
* toggles larger text size
42+
* Toggles larger text size
4343
*
44-
* @param {Element} e element which has a .icon elem as a child
44+
* @param {Element} e Element which has a .icon elem as a child
4545
*/
4646
function toggleTextSize(e) {
4747
if (document.documentElement.classList.contains("shale-v1-bigger-text")) {

workspaces/react/src/components/Button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ export interface BaseButtonProps {
1515
* used to trigger actions when clicked.
1616
*
1717
* @example Simple Button
18+
*
1819
* ```tsx
19-
* <Button variant="primary">Click Me</Button>
20+
* <Button variant="primary">Click Me</Button>;
2021
* ```
2122
*
2223
* @alpha

workspaces/react/src/components/CaptionButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import { css } from "../utils/css";
88
* Use within a {@link CaptionMenu} to render multiple at once.
99
*
1010
* @example Basic example
11+
*
1112
* ```tsx
12-
* <CaptionButton>×</CaptionButton>
13+
* <CaptionButton>×</CaptionButton>;
1314
* ```
1415
*
1516
* @alpha
@@ -29,6 +30,7 @@ export const CaptionButton: PolymorphicComponent<"button"> = ({
2930
* arranging them in a horizontal layout suitable for window controls.
3031
*
3132
* @example Window controls
33+
*
3234
* ```tsx
3335
* <Header>
3436
* <HeaderTitle>
@@ -39,7 +41,7 @@ export const CaptionButton: PolymorphicComponent<"button"> = ({
3941
* <CaptionButton>×</CaptionButton>
4042
* </CaptionMenu>
4143
* </HeaderTitle>
42-
* </Header>
44+
* </Header>;
4345
* ```
4446
*
4547
* @alpha

workspaces/react/src/components/Card.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,25 @@ export interface CardProps {
1414
* card-like visual presentation with optional shadow variants.
1515
*
1616
* @example Basic usage
17+
*
1718
* ```tsx
18-
* <Card shadow="moderate">This is a card with a moderate shadow</Card>
19+
* <Card shadow="moderate">This is a card with a moderate shadow</Card>;
1920
* ```
2021
*
2122
* @example With different shadows
23+
*
2224
* ```tsx
2325
* <FlexContainer variant="space-between">
24-
* <Card flex="third" shadow="subtle">subtle shadows</Card>
25-
* <Card flex="third" shadow="moderate">moderate shadows</Card>
26-
* <Card flex="third" shadow="puffy">puffy shadows</Card>
27-
* </FlexContainer>
26+
* <Card flex="third" shadow="subtle">
27+
* subtle shadows
28+
* </Card>
29+
* <Card flex="third" shadow="moderate">
30+
* moderate shadows
31+
* </Card>
32+
* <Card flex="third" shadow="puffy">
33+
* puffy shadows
34+
* </Card>
35+
* </FlexContainer>;
2836
* ```
2937
*
3038
* @alpha

workspaces/react/src/components/CommandBar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ export interface BaseCommandBarProps {
1111
}
1212

1313
/**
14-
* The `CommandBar` component provides a container for command-based UI elements,
15-
* typically used for toolbars or action bars.
14+
* The `CommandBar` component provides a container for command-based UI
15+
* elements, typically used for toolbars or action bars.
1616
*
1717
* @example Basic usage
18+
*
1819
* ```tsx
1920
* <CommandBar>
2021
* <Button variant="secondary">Save</Button>
2122
* <Button variant="secondary">Edit</Button>
2223
* <Button variant="secondary">Delete</Button>
23-
* </CommandBar>
24+
* </CommandBar>;
2425
* ```
2526
*
2627
* @alpha

0 commit comments

Comments
 (0)