From e6f65acede97a91432bf1d0c79b969bc7653d943 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Tue, 31 Dec 2019 13:54:47 +0530 Subject: [PATCH] prettier - Format existing files with prettier --- example/src/App.js | 16 ++++++---------- example/src/index.js | 10 +++++----- src/index.tsx | 12 +++++------- src/test.ts | 12 ++++++------ 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/example/src/App.js b/example/src/App.js index 687725c..c020712 100644 --- a/example/src/App.js +++ b/example/src/App.js @@ -1,13 +1,9 @@ -import React from 'react' +import React from "react"; -import { useMyHook } from 'some-hooks' +import { useMyHook } from "some-hooks"; const App = () => { - const example = useMyHook() - return ( -
- {example} -
- ) -} -export default App + const example = useMyHook(); + return
{example}
; +}; +export default App; diff --git a/example/src/index.js b/example/src/index.js index daa5843..763f239 100644 --- a/example/src/index.js +++ b/example/src/index.js @@ -1,7 +1,7 @@ -import React from 'react' -import ReactDOM from 'react-dom' +import React from "react"; +import ReactDOM from "react-dom"; -import './index.css' -import App from './App' +import "./index.css"; +import App from "./App"; -ReactDOM.render(, document.getElementById('root')) +ReactDOM.render(, document.getElementById("root")); diff --git a/src/index.tsx b/src/index.tsx index b10474f..3147077 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,9 +1,7 @@ -import * as React from 'react'; +import * as React from "react"; export const useMyHook = () => { - let [{ - counter - }, setState] = React.useState<{ + let [{ counter }, setState] = React.useState<{ counter: number; }>({ counter: 0 @@ -12,12 +10,12 @@ export const useMyHook = () => { React.useEffect(() => { let interval = window.setInterval(() => { counter++; - setState({counter}) - }, 1000) + setState({ counter }); + }, 1000); return () => { window.clearInterval(interval); }; }, []); return counter; -}; \ No newline at end of file +}; diff --git a/src/test.ts b/src/test.ts index 03dd6b4..77dc609 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,7 +1,7 @@ -import { useMyHook } from './' +import { useMyHook } from "./"; -describe('useMyHook', () => { - it('is truthy', () => { - expect(useMyHook).toBeTruthy() - }) -}) +describe("useMyHook", () => { + it("is truthy", () => { + expect(useMyHook).toBeTruthy(); + }); +});