Skip to content

Commit 1e14309

Browse files
committed
Set up Prettier
1 parent 02e51f8 commit 1e14309

10 files changed

Lines changed: 39 additions & 36 deletions

File tree

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"license": "MIT",
55
"private": false,
66
"dependencies": {
7+
"react": "^19.1.0",
8+
"react-dom": "^19.1.0",
9+
"web-vitals": "^2.1.0"
10+
},
11+
"devDependencies": {
712
"@testing-library/dom": "^10.4.0",
813
"@testing-library/jest-dom": "^6.6.3",
914
"@testing-library/react": "^16.1.0",
@@ -12,17 +17,16 @@
1217
"@types/node": "^16.7.13",
1318
"@types/react": "^19.0.0",
1419
"@types/react-dom": "^19.0.0",
15-
"react": "^19.1.0",
16-
"react-dom": "^19.1.0",
20+
"prettier": "^3.5.3",
1721
"react-scripts": "5.0.1",
18-
"typescript": "^4.4.2",
19-
"web-vitals": "^2.1.0"
22+
"typescript": "^4.4.2"
2023
},
2124
"scripts": {
2225
"start": "react-scripts start",
2326
"build": "react-scripts build",
2427
"test": "react-scripts test",
25-
"eject": "react-scripts eject"
28+
"eject": "react-scripts eject",
29+
"format": "prettier --write ."
2630
},
2731
"eslintConfig": {
2832
"extends": [

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

src/App.test.tsx

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

5-
test('renders learn react link', () => {
5+
test("renders learn react link", () => {
66
render(<App />);
77
const linkElement = screen.getByText(/learn react/i);
88
expect(linkElement).toBeInTheDocument();

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import logo from './logo.svg';
3-
import './App.css';
1+
import React from "react";
2+
import logo from "./logo.svg";
3+
import "./App.css";
44

55
function App() {
66
return (

src/index.css

Lines changed: 5 additions & 5 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',
5-
sans-serif;
3+
font-family:
4+
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
5+
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 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',
12-
monospace;
11+
font-family:
12+
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
1313
}

src/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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

77
const root = ReactDOM.createRoot(
8-
document.getElementById('root') as HTMLElement
8+
document.getElementById("root") as HTMLElement,
99
);
1010
root.render(
1111
<React.StrictMode>
1212
<App />
13-
</React.StrictMode>
13+
</React.StrictMode>,
1414
);
1515

1616
// If you want to start measuring performance in your app, pass a function

src/reportWebVitals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ReportHandler } from 'web-vitals';
1+
import { ReportHandler } from "web-vitals";
22

33
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
44
if (onPerfEntry && onPerfEntry instanceof Function) {
5-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
5+
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
66
getCLS(onPerfEntry);
77
getFID(onPerfEntry);
88
getFCP(onPerfEntry);

src/setupTests.ts

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";

tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -20,7 +16,5 @@
2016
"noEmit": true,
2117
"jsx": "react-jsx"
2218
},
23-
"include": [
24-
"src"
25-
]
19+
"include": ["src"]
2620
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7608,6 +7608,11 @@ prelude-ls@~1.1.2:
76087608
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
76097609
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==
76107610

7611+
prettier@^3.5.3:
7612+
version "3.5.3"
7613+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5"
7614+
integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==
7615+
76117616
pretty-bytes@^5.3.0, pretty-bytes@^5.4.1:
76127617
version "5.6.0"
76137618
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"

0 commit comments

Comments
 (0)