From f07e43602933518daf1b4085e24fe8a83bed527c Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Sun, 25 Mar 2018 10:40:48 -0700 Subject: [PATCH 1/2] reformat existing code that wasnt --- hyperapp.d.ts | 4 +++- test/ts/Component.tsx | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hyperapp.d.ts b/hyperapp.d.ts index 0daca2d71..c44cd740f 100644 --- a/hyperapp.d.ts +++ b/hyperapp.d.ts @@ -18,7 +18,9 @@ export interface VNode { * @memberOf [VDOM] */ export interface Component { - (attributes: Attributes, children: Array): VNode | View + (attributes: Attributes, children: Array): + | VNode + | View } /** diff --git a/test/ts/Component.tsx b/test/ts/Component.tsx index 675e01afc..7ad30c222 100644 --- a/test/ts/Component.tsx +++ b/test/ts/Component.tsx @@ -9,16 +9,21 @@ interface Actions { up(value: number): State } -const Counter: Component<{ state: State, actions: Actions }> = ({ state, actions }) => +const Counter: Component<{ state: State; actions: Actions }> = ({ + state, + actions +}) => (
{state.count}
+) -const LazyCounter: Component<{}, State, Actions> = () => (state, actions) => +const LazyCounter: Component<{}, State, Actions> = () => (state, actions) => (
{state.count}
+) From eca4228fab1431f9afa5c05c26139f54903cf261 Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Sun, 25 Mar 2018 10:41:52 -0700 Subject: [PATCH 2/2] move prettier config option outside of cli argument in script so other tools can use it i.e. format on save in editors --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 86582fbc2..2f44ce562 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "bundle": "rollup -i src/index.js -o dist/hyperapp.js -m -f umd -n hyperapp", "minify": "uglifyjs dist/hyperapp.js -o dist/hyperapp.js -mc pure_funcs=['Object.defineProperty'] --source-map includeSources,url=hyperapp.js.map", "prepare": "npm run build", - "format": "prettier --semi false --write {src,test}/**/*.js {,test/ts/}*.{ts,tsx}", + "format": "prettier --write {src,test}/**/*.js {,test/ts/}*.{ts,tsx}", "release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "babel": { @@ -49,5 +49,8 @@ "rollup": "^0.55.3", "typescript": "2.7.1", "uglify-js": "3.3.9" + }, + "prettier": { + "semi": false } }