Skip to content

Commit a70d6e0

Browse files
committed
Use oxfmt
1 parent bb19519 commit a70d6e0

10 files changed

Lines changed: 277 additions & 72 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
- name: Install dependencies
3131
run: npm ci
3232

33+
- name: Check formatting
34+
run: npm run format:check
35+
3336
- name: Rebuild ReScript code
3437
run: npm run build
3538

@@ -81,4 +84,4 @@ jobs:
8184
steps:
8285
- name: Deploy to GitHub Pages
8386
id: deployment
84-
uses: actions/deploy-pages@v4
87+
uses: actions/deploy-pages@v4

docs/content/docs/contributing/api-modelling.mdx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ String(unsafeConversation(t))
112112
}
113113
`
114114

115-
<Code
116-
code={fillStyleModule}
117-
title="DOMAPI/FillStyle.res"
118-
lang="ReScript"
119-
></Code>
115+
<Code code={fillStyleModule} title="DOMAPI/FillStyle.res" lang="ReScript"></Code>
120116

121117
We can now use `FillStyle.decode` to get the actual value of the `fillStyle` property.
122118
And use `FillStyle.fromString`, `FillStyle.fromCanvasGradient`, and `FillStyle.fromCanvasPattern` to set the value.
@@ -135,11 +131,5 @@ switch ctx.fillStyle->FillStyle.decode {
135131
}
136132
```
137133

138-
<Icon
139-
name="information"
140-
color="var(--sl-color-text-accent)"
141-
class="inline-icon"
142-
size="1.5rem"
143-
/>
144-
Try and use `decoded` and `decode` as conventions for the type and function
145-
names.
134+
<Icon name="information" color="var(--sl-color-text-accent)" class="inline-icon" size="1.5rem" />
135+
Try and use `decoded` and `decode` as conventions for the type and function names.

docs/content/docs/contributing/api-module-structure.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ type htmlSpanElement = {
5151
```
5252

5353
<Aside>
54-
Properties spreading is not possible in recursive types! When a circular
55-
reference is detected, the base properties are duplicated instead.
54+
Properties spreading is not possible in recursive types! When a circular reference is detected,
55+
the base properties are duplicated instead.
5656
</Aside>
5757

5858
```ReScript

docs/content/docs/contributing/code-generation.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ interfaceHierarchy = [
6464
name: "Temp",
6565
entries: [
6666
enums(["WebGLPowerPreference"]),
67-
dictionaries([
68-
"ImageBitmapRenderingContextSettings",
69-
"WebGLContextAttributes",
70-
]),
67+
dictionaries(["ImageBitmapRenderingContextSettings", "WebGLContextAttributes"]),
7168
],
7269
opens: [],
7370
},

docs/content/docs/contributing/getting-started.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ slug: "01-getting-started"
77
import { Aside } from "@astrojs/starlight/components";
88

99
<Aside type="caution">
10-
**Real talk**: First time diving into this project? Might feel like a letdown.
11-
But hey, the upside? It’s stupid easy to toss us a PR and make it better!
10+
**Real talk**: First time diving into this project? Might feel like a letdown. But hey, the
11+
upside? It’s stupid easy to toss us a PR and make it better!
1212
</Aside>
1313

1414
The [WebAPI](https://developer.mozilla.org/en-US/docs/Web/API) are vast and ever-growing. We need your help to make them better.

docs/content/docs/contributing/module-type-structure.mdx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ open DOMAPI
4545
// A concrete type for \`T.t\` is passed later using the \`include\` keyword.
4646
module Impl = (T: { type t }) => {
4747
48-
/**
48+
/\*_
4949
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus)
50-
*/
50+
_/
5151
@send
5252
external focus: (T.t, ~options: focusOptions=?) => unit = "focus"
5353
@@ -56,11 +56,7 @@ external focus: (T.t, ~options: focusOptions=?) => unit = "focus"
5656
include Impl({ type t = htmlElement })
5757
`;
5858

59-
<Code
60-
code={htmlElementModule}
61-
title="DOMAPI/HTMLElement.res"
62-
lang="ReScript"
63-
></Code>
59+
<Code code={htmlElementModule} title="DOMAPI/HTMLElement.res" lang="ReScript"></Code>
6460

6561
export const buttonModule = `
6662
open DOMAPI
@@ -70,17 +66,12 @@ include HTMLElement.Impl({ type t = htmlButtonElement })
7066
7167
// Add additional methods specific to HTMLButtonElement:
7268
73-
/**
69+
/\*_
7470
Returns whether a form will validate when it is submitted, without having to submit it.
75-
[Read more on MDN](
76-
https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/checkValidity)
77-
*/
71+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/checkValidity)
72+
_/
7873
@send
7974
external checkValidity: htmlButtonElement => bool = "checkValidity"
8075
`;
8176

82-
<Code
83-
code={buttonModule}
84-
title="DOMAPI/HTMLButtonElement.res"
85-
lang="ReScript"
86-
></Code>
77+
<Code code={buttonModule} title="DOMAPI/HTMLButtonElement.res" lang="ReScript"></Code>

docs/content/docs/contributing/testing.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ npm test
3636
If any of the existing tests have different ouput JavaScript, you will see a diff in the output and the test will fail.
3737

3838
<Aside>
39-
Depending on your use-case, it might be okay to have slightly different output
40-
JavaScript. The maintainers will help you to decide if the change is
41-
acceptable.
39+
Depending on your use-case, it might be okay to have slightly different output JavaScript. The
40+
maintainers will help you to decide if the change is acceptable.
4241
</Aside>
4342

4443
## Why add tests?

docs/content/docs/index.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,10 @@ Install the package using your favorite package manager:
2727

2828
<Tabs syncKey="package manager">
2929
<TabItem label="npm">
30-
<Code
31-
lang="shell"
32-
frame="none"
33-
code="npm i @rescript/webapi@experimental"
34-
/>
30+
<Code lang="shell" frame="none" code="npm i @rescript/webapi@experimental" />
3531
</TabItem>
3632
<TabItem label="bun">
37-
<Code
38-
lang="shell"
39-
frame="none"
40-
code="bun i @rescript/webapi@experimental"
41-
/>
33+
<Code lang="shell" frame="none" code="bun i @rescript/webapi@experimental" />
4234
</TabItem>
4335
</Tabs>
4436

0 commit comments

Comments
 (0)