Skip to content

Commit 87cfdfa

Browse files
committed
Apply prettier esbenp.prettier-vscode
1 parent eaa4451 commit 87cfdfa

File tree

11 files changed

+134
-139
lines changed

11 files changed

+134
-139
lines changed

react-app/src/App.css

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
.App {
2-
height: 100vh;
3-
margin: 0;
4-
padding: 0;
5-
overflow: hidden;
6-
font-family: 'Roboto Mono', monospace;
2+
height: 100vh;
3+
margin: 0;
4+
padding: 0;
5+
overflow: hidden;
6+
font-family: "Roboto Mono", monospace;
77
}
88

99
header {
10-
position: relative;
11-
height: 80px;
12-
padding: 10px 20px;
13-
border-bottom: 2px solid #808080;
14-
box-sizing: border-box;
10+
position: relative;
11+
height: 80px;
12+
padding: 10px 20px;
13+
border-bottom: 2px solid #808080;
14+
box-sizing: border-box;
1515
}
1616

1717
h1 {
18-
margin: 0 0 8px 0;
18+
margin: 0 0 8px 0;
1919
}
2020

2121
a {
22-
text-decoration: none;
22+
text-decoration: none;
2323
}
2424

2525
main {
26-
overflow: hidden;
27-
display: flex;
28-
flex-direction: row;
29-
-webkit-align-items: stretch;
30-
align-items: stretch;
31-
height: calc(100% - 80px);
26+
overflow: hidden;
27+
display: flex;
28+
flex-direction: row;
29+
-webkit-align-items: stretch;
30+
align-items: stretch;
31+
height: calc(100% - 80px);
3232
}
3333

3434
.input,
3535
.output {
36-
display: flex;
37-
-webkit-align-items: stretch;
38-
align-items: stretch;
39-
width: 50%;
40-
height: 100%;
36+
display: flex;
37+
-webkit-align-items: stretch;
38+
align-items: stretch;
39+
width: 50%;
40+
height: 100%;
4141
}
4242

4343
.output {
44-
border-left: 2px solid #808080;
44+
border-left: 2px solid #808080;
4545
}
4646

4747
button {
48-
width: 100%;
49-
height: 2em;
48+
width: 100%;
49+
height: 2em;
5050
}
5151

5252
textarea {
53-
width: 100%;
54-
height: 100%;
55-
padding: 20px;
56-
border: 0;
57-
box-sizing: border-box;
58-
font-size: 1.3em;
59-
resize: none;
60-
outline: none;
61-
line-height: 1.3;
62-
font-family: 'Roboto Mono', monospace;
63-
}
53+
width: 100%;
54+
height: 100%;
55+
padding: 20px;
56+
border: 0;
57+
box-sizing: border-box;
58+
font-size: 1.3em;
59+
resize: none;
60+
outline: none;
61+
line-height: 1.3;
62+
font-family: "Roboto Mono", monospace;
63+
}

react-app/src/App.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import './App.css';
1+
import "./App.css";
22
import Header from "./components/Header";
33
import React from "react";
44
import Body from "./components/Body";
55

66
function App() {
7-
return (
8-
<div className="App">
9-
<Header/>
10-
<Body/>
11-
</div>
12-
);
7+
return (
8+
<div className="App">
9+
<Header />
10+
<Body />
11+
</div>
12+
);
1313
}
1414

1515
export default App;

react-app/src/App.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {render, screen} from '@testing-library/react';
2-
import App from './App';
1+
import { render, screen } from "@testing-library/react";
2+
import App from "./App";
33

4-
test('renders learn react link', () => {
5-
render(<App/>);
6-
const linkElement = screen.getByText(/learn react/i);
4+
test("renders learn react link", () => {
5+
render(<App />);
6+
const linkElement = screen.getByText(/SQL Formatter for C#/i);
77
expect(linkElement).toBeInTheDocument();
88
});

react-app/src/components/Body.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import Input from "./Input";
2-
import React, {useState} from "react";
2+
import React, { useState } from "react";
33
import Output from "./Output";
44

55
function Body() {
6-
const [outputValue, setOutputValue] = useState('');
6+
const [outputValue, setOutputValue] = useState("");
77

8-
const handleInputChange = (inputValue) => {
9-
if (!!inputValue.trim()) {
10-
fetch('http://localhost:5073/format_sql', {
11-
method: 'POST',
12-
mode: 'cors',
13-
body: inputValue,
14-
})
15-
.then((response) => response.text())
16-
.then((result) => setOutputValue(result))
17-
.catch((error) => {
18-
alert(error)
19-
});
20-
} else {
21-
setOutputValue('');
22-
}
23-
};
8+
const handleInputChange = (inputValue) => {
9+
if (!!inputValue.trim()) {
10+
fetch("http://localhost:5073/format_sql", {
11+
method: "POST",
12+
mode: "cors",
13+
body: inputValue,
14+
})
15+
.then((response) => response.text())
16+
.then((result) => setOutputValue(result))
17+
.catch((error) => {
18+
alert(error);
19+
});
20+
} else {
21+
setOutputValue("");
22+
}
23+
};
2424

25-
return (
26-
<>
27-
<main>
28-
<Input onInputChange={handleInputChange}/>
29-
<Output outputValue={outputValue}/>
30-
</main>
31-
</>
32-
)
25+
return (
26+
<>
27+
<main>
28+
<Input onInputChange={handleInputChange} />
29+
<Output outputValue={outputValue} />
30+
</main>
31+
</>
32+
);
3333
}
3434

3535
export default Body;

react-app/src/components/Header.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from 'react';
1+
import React from "react";
22

33
function Header() {
4-
return (
5-
<>
6-
<header>
7-
<h1>SQL Formatter for C#</h1>
8-
</header>
9-
</>
10-
);
4+
return (
5+
<>
6+
<header>
7+
<h1>SQL Formatter for C#</h1>
8+
</header>
9+
</>
10+
);
1111
}
1212

1313
export default Header;

react-app/src/components/Input.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import React, {useEffect, useState} from 'react';
1+
import React, { useEffect, useState } from "react";
22

3-
function Input({onInputChange}) {
4-
// noinspection SqlDialectInspection,SqlNoDataSourceInspection
5-
const [inputValue, setInputValue] = useState(
6-
'SELECT supplier_name, city FROM suppliers\n' +
7-
'WHERE supplier_id > 500\n' +
8-
'ORDER BY supplier_name ASC, city DESC;');
3+
function Input({ onInputChange }) {
4+
const [inputValue, setInputValue] = useState(
5+
"SELECT supplier_name, city FROM suppliers\n" +
6+
"WHERE supplier_id > 500\n" +
7+
"ORDER BY supplier_name ASC, city DESC;"
8+
);
99

10-
useEffect(() => {
11-
const handleChange = () => {
12-
onInputChange(inputValue);
13-
};
10+
useEffect(() => {
11+
const handleChange = () => {
12+
onInputChange(inputValue);
13+
};
1414

15-
let timeout;
16-
if (inputValue.trim()) {
17-
timeout = setTimeout(handleChange, 500);
18-
} else {
19-
onInputChange('');
20-
}
15+
let timeout;
16+
if (inputValue.trim()) {
17+
timeout = setTimeout(handleChange, 500);
18+
} else {
19+
onInputChange("");
20+
}
2121

22-
return () => {
23-
clearTimeout(timeout);
24-
};
25-
}, [inputValue, onInputChange]);
22+
return () => {
23+
clearTimeout(timeout);
24+
};
25+
}, [inputValue, onInputChange]);
2626

27-
return (
28-
<section className="input">
29-
<textarea
30-
id="input"
31-
autoFocus
32-
wrap="off"
33-
value={inputValue}
34-
onChange={(e) => setInputValue(e.target.value)}
35-
/>
36-
</section>
37-
);
27+
return (
28+
<section className="input">
29+
<textarea
30+
id="input"
31+
autoFocus
32+
wrap="off"
33+
value={inputValue}
34+
onChange={(e) => setInputValue(e.target.value)}
35+
/>
36+
</section>
37+
);
3838
}
3939

4040
export default Input;

react-app/src/components/Output.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import React from 'react';
1+
import React from "react";
22

3-
function Output({outputValue}) {
4-
return (
5-
<section className="output">
6-
<textarea
7-
id="output"
8-
readOnly
9-
wrap="off"
10-
value={outputValue}
11-
/>
12-
</section>
13-
);
3+
function Output({ outputValue }) {
4+
return (
5+
<section className="output">
6+
<textarea id="output" readOnly wrap="off" value={outputValue} />
7+
</section>
8+
);
149
}
1510

1611
export default Output;

react-app/src/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
3+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
55
sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
1212
monospace;
1313
}

react-app/src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom/client';
3-
import './index.css';
4-
import App from './App';
5-
import reportWebVitals from './reportWebVitals';
1+
import React from "react";
2+
import ReactDOM from "react-dom/client";
3+
import "./index.css";
4+
import App from "./App";
5+
import reportWebVitals from "./reportWebVitals";
66

7-
const root = ReactDOM.createRoot(document.getElementById('root'));
7+
const root = ReactDOM.createRoot(document.getElementById("root"));
88
root.render(
99
<React.StrictMode>
1010
<App />

react-app/src/reportWebVitals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const reportWebVitals = onPerfEntry => {
1+
const reportWebVitals = (onPerfEntry) => {
22
if (onPerfEntry && onPerfEntry instanceof Function) {
3-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
3+
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
44
getCLS(onPerfEntry);
55
getFID(onPerfEntry);
66
getFCP(onPerfEntry);

react-app/src/setupTests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// allows you to do things like:
33
// expect(element).toHaveTextContent(/react/i)
44
// learn more: https://github.com/testing-library/jest-dom
5-
import '@testing-library/jest-dom';
5+
import "@testing-library/jest-dom";

0 commit comments

Comments
 (0)