Skip to content

Commit

Permalink
Make client rules more consistent with server styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-yu committed Jun 25, 2020
1 parent 7070320 commit 22cc3c9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
12 changes: 11 additions & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@
"lint": "npx eslint src/**/*.js"
},
"eslintConfig": {
"extends": "react-app"
"extends": "react-app",
"rules": {
"quotes": [
"error",
"single"
],
"object-curly-spacing": [
"error",
"always"
]
}
},
"proxy": "http://localhost:8080",
"browserslist": {
Expand Down
11 changes: 5 additions & 6 deletions packages/client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import logo from './logo.svg';
import './App.css';

function App() {

var [apiStatus, setApiStatus] = useState(null);

useEffect(() => {
fetch("/heartbeat")
.then(res => res.text())
.then(data => setApiStatus(data))
.catch(err => console.log(err));
fetch('/heartbeat')
.then((res) => res.text())
.then((data) => setApiStatus(data))
.catch((err) => console.log(err));
}, []);

return (
Expand All @@ -28,7 +27,7 @@ function App() {
>
Learn React
</a>
{ apiStatus }
{apiStatus}
</header>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions packages/client/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { render } from "@testing-library/react";
import App from "./App";
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';

test("renders learn react link", () => {
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
Expand Down

0 comments on commit 22cc3c9

Please sign in to comment.