prettier - Format existing files with prettier

This commit is contained in:
2019-12-31 13:54:47 +05:30
parent 3c2777c4af
commit e6f65acede
4 changed files with 22 additions and 28 deletions
+6 -10
View File
@@ -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 (
<div>
{example}
</div>
)
}
export default App
const example = useMyHook();
return <div>{example}</div>;
};
export default App;
+5 -5
View File
@@ -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(<App />, document.getElementById('root'))
ReactDOM.render(<App />, document.getElementById("root"));
+5 -7
View File
@@ -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;
};
};
+6 -6
View File
@@ -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();
});
});