Skip to content

Commit

Permalink
Use prettier yarn package, add prettier configs, force lf line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
DUDEbehindDUDE committed Nov 21, 2024
1 parent 8f12765 commit 68d54c1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
cache: "yarn"
cache-dependency-path: react/yarn.lock
- run: yarn
- run: npx prettier . --check
- run: yarn build --if-present
- run: yarn test
- run: yarn prettier . --check
4 changes: 4 additions & 0 deletions react/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore yarn.lock and other Yarn-specific files
yarn.lock
package.json
**/node_modules/*
3 changes: 3 additions & 0 deletions react/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"endOfLine": "lf"
}
3 changes: 2 additions & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"prettier": "^3.3.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion react/src/components/WebSocketContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "types/websocket";

const WebSocketContext = createContext<WebSocketContextType | undefined>(
undefined
undefined,
);

export function WebSocketProvider({ children }: { children: React.ReactNode }) {
Expand Down
4 changes: 2 additions & 2 deletions react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import App from "./components/App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
document.getElementById("root") as HTMLElement,
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);

// If you want to start measuring performance in your app, pass a function
Expand Down
5 changes: 5 additions & 0 deletions react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7727,6 +7727,11 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==

prettier@^3.3.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==

pretty-bytes@^5.3.0, pretty-bytes@^5.4.1:
version "5.6.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"
Expand Down

0 comments on commit 68d54c1

Please sign in to comment.