Skip to content

Commit 655efd2

Browse files
committed
Add prettier check, fix all prettier issues
1 parent dfdcb4a commit 655efd2

22 files changed

Lines changed: 199 additions & 135 deletions

.github/workflows/main.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,30 @@ jobs:
4040
run: yarn run lint
4141
- name: build
4242
run: yarn run build
43+
prettier:
44+
name: Prettier
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 1
50+
- name: Enable corepack
51+
run: corepack enable
52+
- uses: actions/setup-node@v4
53+
env:
54+
yarn: 4.12.0
55+
with:
56+
node-version: 24
57+
cache: 'yarn'
58+
- name: Install dependencies
59+
run: yarn install
60+
- name: Prettier check
61+
run: yarn run prettier:check
4362
deploy:
4463
name: Deploy to production
4564
if: github.event_name == 'release'
4665
runs-on: ubuntu-latest
47-
needs: lint
66+
needs: [lint, prettier]
4867
steps:
4968
- uses: actions/checkout@v4
5069
with:

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/__generated__

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"arrowParens": "always",
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"jsxSingleQuote": false,
10+
"bracketSameLine": false,
11+
"semi": true
12+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"test": "react-scripts test",
2121
"eject": "react-scripts eject",
2222
"relay": "relay-compiler $@",
23-
"lint": "eslint ."
23+
"lint": "eslint .",
24+
"prettier:check": "prettier --check ./src",
25+
"prettier:write": "prettier --write ./src"
2426
},
2527
"eslintConfig": {
2628
"extends": "react-app"
@@ -47,6 +49,7 @@
4749
"eslint": "^9.39.2",
4850
"eslint-plugin-react": "^7.37.5",
4951
"graphql": "^16.10.0",
52+
"prettier": "^3.8.1",
5053
"relay-compiler": "^20.1.1",
5154
"relay-compiler-language-typescript": "^15.0.0",
5255
"typescript": "^5.7.3",

src/App.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
html, body, #root {
1+
html,
2+
body,
3+
#root {
24
min-height: 100vh;
35
}
46

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const App = () => (
2323
</main>
2424
<Footer />
2525
</>
26-
</BrowserRouter>
26+
</BrowserRouter>
2727
</RelayEnvironmentProvider>
2828
);
2929

src/components/Footer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ const Footer = () => (
88
<Container fluid={true}>
99
<Row>
1010
<Col>
11-
Created with <i className="fas fa-heart" style={{ color: 'red' }}></i> by <a href="https://juffalow.com" style={{ color: '#fff', textDecoration: 'none' }}>Matej <span style={{ color: 'red' }}>&apos;juffalow&apos;</span> Jellus</a> | 2019 - 2025
11+
Created with <i className="fas fa-heart" style={{ color: 'red' }}></i> by{' '}
12+
<a href="https://juffalow.com" style={{ color: '#fff', textDecoration: 'none' }}>
13+
Matej <span style={{ color: 'red' }}>&apos;juffalow&apos;</span> Jellus
14+
</a>{' '}
15+
| 2019 - 2025
1216
</Col>
1317
</Row>
1418
</Container>

src/components/Menu.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import { Link } from 'react-router-dom';
77
const Menu = () => (
88
<Navbar bg="dark" variant="dark" expand="lg">
99
<Container fluid>
10-
<Navbar.Brand as={Link} to="/">Quotes</Navbar.Brand>
10+
<Navbar.Brand as={Link} to="/">
11+
Quotes
12+
</Navbar.Brand>
1113
<Navbar.Toggle aria-controls="basic-navbar-nav" />
1214
<Navbar.Collapse id="basic-navbar-nav">
1315
<Nav className="mr-auto">
14-
<Nav.Link as={Link} to="/authors">Authors</Nav.Link>
16+
<Nav.Link as={Link} to="/authors">
17+
Authors
18+
</Nav.Link>
1519
</Nav>
1620
</Navbar.Collapse>
1721
</Container>

src/environment.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
Environment,
3-
Network,
4-
RecordSource,
5-
Store,
6-
} from 'relay-runtime';
1+
import { Environment, Network, RecordSource, Store } from 'relay-runtime';
72
import { RequestParameters } from 'relay-runtime/lib/util/RelayConcreteNode';
83
import { Variables } from 'relay-runtime/lib/util/RelayRuntimeTypes';
94

src/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import ReactDOM from 'react-dom/client';
33
import App from './App';
44
import * as serviceWorker from './serviceWorker';
55

6-
const root = ReactDOM.createRoot(
7-
document.getElementById('root') as HTMLElement
8-
);
6+
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
97
root.render(
108
<React.StrictMode>
119
<App />

0 commit comments

Comments
 (0)