Skip to content

Commit 3d1daa0

Browse files
committed
refactor: Format Reason code
1 parent f3b4d56 commit 3d1daa0

File tree

7 files changed

+38
-27
lines changed

7 files changed

+38
-27
lines changed

bsconfig.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
22
"name": "bs-storybook",
33
"namespace": true,
4-
"bsc-flags": ["-bs-super-errors"],
4+
"bsc-flags": [
5+
"-bs-super-errors"
6+
],
57
"version": "0.1.0",
6-
"sources": ["src"],
7-
"bs-dependencies": ["reason-react"],
8-
"reason": { "react-jsx": 2 },
8+
"sources": [
9+
"src"
10+
],
11+
"bs-dependencies": [
12+
"reason-react"
13+
],
14+
"reason": {
15+
"react-jsx": 2
16+
},
917
"refmt": 3
1018
}

src/action.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
type actionHandler('a) = 'a => unit;
22

33
[@bs.val] [@bs.module "@storybook/addon-actions"]
4-
external action : string => actionHandler('a) = "";
4+
external action: string => actionHandler('a);

src/addons.re

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ type channelListener = string => unit;
1111
type panelConfig = {
1212
.
1313
"title": string,
14-
"render": unit => ReasonReact.reactElement
14+
"render": unit => ReasonReact.reactElement,
1515
};
1616

17-
[@bs.module "@storybook/addons"] external addons : t = "default";
17+
[@bs.module "@storybook/addons"] external addons: t = "default";
1818

19-
[@bs.send] external register : (t, string, callback) => unit = "register";
19+
[@bs.send] external register: (t, string, callback) => unit = "register";
2020

21-
[@bs.send] external addPanel : (t, string, panelConfig) => unit = "addPanel";
21+
[@bs.send] external addPanel: (t, string, panelConfig) => unit = "addPanel";
2222

23-
[@bs.send] external getChannel : (t, unit) => channel = "getChannel";
23+
[@bs.send] external getChannel: (t, unit) => channel = "getChannel";
2424

25-
[@bs.send] external emitChannel : (channel, string, string) => unit = "emit";
25+
[@bs.send] external emitChannel: (channel, string, string) => unit = "emit";
2626

2727
[@bs.send]
28-
external onChannel : (channel, string, channelListener) => unit = "on";
28+
external onChannel: (channel, string, channelListener) => unit = "on";
2929

3030
[@bs.send]
31-
external removeChannelListener : (channel, string, channelListener) => unit =
31+
external removeChannelListener: (channel, string, channelListener) => unit =
3232
"removeListener";
3333

34-
[@bs.send] external onStory : (api, unit => unit) => unit = "onStory";
34+
[@bs.send] external onStory: (api, unit => unit) => unit = "onStory";

src/knobs.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
2-
external withKnobs: Main.decorator = "";
2+
external withKnobs: Main.decorator;
33

44
[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
55
external extText: (string, Js.null_undefined(string)) => string = "text";

src/main.re

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ type chapter = unit => ReasonReact.reactElement;
33
type section;
44

55
[@bs.val] [@bs.module "@storybook/react"]
6-
external storiesOf : (string, 'a) => section =
7-
"";
6+
external storiesOf: (string, 'a) => section;
87

9-
[@bs.send] external extAdd : (section, string, chapter) => unit = "add";
8+
[@bs.send] external extAdd: (section, string, chapter) => unit = "add";
109

1110
type decorator = chapter => ReasonReact.reactElement;
1211

13-
[@bs.send] external addDecorator : (section, decorator) => unit = "";
12+
[@bs.send] external addDecorator: (section, decorator) => unit;
1413

1514
type webpackModule;
1615

@@ -19,9 +18,14 @@ type chapterAdd = (string, chapter) => unit;
1918
type story = {add: chapterAdd};
2019

2120
let createStory =
22-
(~title: string, ~decorators: list(decorator), ~_module: webpackModule, ())
21+
(
22+
~title: string,
23+
~decorators: list(decorator),
24+
~_module: webpackModule,
25+
(),
26+
)
2327
: story => {
2428
let story = storiesOf(title, _module);
25-
List.iter((dec) => addDecorator(story, dec), decorators);
26-
{add: (name: string, c: chapter) => extAdd(story, name, c)}
29+
List.iter(dec => addDecorator(story, dec), decorators);
30+
{add: (name: string, c: chapter) => extAdd(story, name, c)};
2731
};

src/notes.re

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
type decoratedChapter = Main.chapter => Main.chapter;
22

33
[@bs.module "@storybook/addon-notes"]
4-
external withNotes : string => decoratedChapter =
5-
"";
4+
external withNotes: string => decoratedChapter;

src/story.re

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ type chapter = unit => ReasonReact.reactElement;
77
type decorator = chapter => ReasonReact.reactElement;
88

99
[@bs.val] [@bs.module "@storybook/react"]
10-
external storiesOf : (string, webpackModule) => section = "";
10+
external storiesOf: (string, webpackModule) => section;
1111

12-
[@bs.send] external add : (section, string, chapter) => section = "";
12+
[@bs.send] external add: (section, string, chapter) => section;
1313

14-
[@bs.send] external addDecorator : (section, decorator) => section = "";
14+
[@bs.send] external addDecorator: (section, decorator) => section;

0 commit comments

Comments
 (0)