-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from ls1intum/43-create-a-prettier-code-format…
…-configuration-for-the-monorepo feat: 43 create a prettier code format configuration for the monorepo
- Loading branch information
Showing
14 changed files
with
79 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
npm run format | ||
npm run lint | ||
npm run format:check | ||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"singleQuote": false, | ||
"semi": false, | ||
"trailingComma": "es5", | ||
"arrowParens": "always", | ||
"bracketSpacing": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import ReactDOM from "react-dom/client"; | ||
import { App } from "./App"; | ||
import ReactDOM from "react-dom/client" | ||
import { App } from "./App" | ||
|
||
export class Apollon2 { | ||
private root: ReactDOM.Root | null = null; | ||
private root: ReactDOM.Root | null = null | ||
|
||
constructor(element: HTMLElement) { | ||
this.root = ReactDOM.createRoot(element); | ||
this.root.render(<App />); | ||
this.root = ReactDOM.createRoot(element) | ||
this.root.render(<App />) | ||
} | ||
|
||
public getRandomNumber(): number { | ||
return Math.random() * 100; | ||
return Math.random() * 100 | ||
} | ||
|
||
public dispose() { | ||
if (this.root) { | ||
this.root.unmount(); | ||
this.root = null; | ||
this.root.unmount() | ||
this.root = null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import express from "express"; | ||
import express from "express" | ||
|
||
const app = express(); | ||
const port = 3000; | ||
const app = express() | ||
const port = 3000 | ||
|
||
app.get("/", (req: any, res: any) => { | ||
res.send("Hello from Backend!"); | ||
}); | ||
res.send("Hello from Backend!") | ||
}) | ||
|
||
app.listen(port, () => { | ||
console.log(`Server running on http://localhost:${port}`); | ||
}); | ||
console.log(`Server running on http://localhost:${port}`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { useState } from "react"; | ||
import { LibraryView } from "./LibraryView"; | ||
import { useState } from "react" | ||
import { LibraryView } from "./LibraryView" | ||
|
||
function App() { | ||
const [count, setCount] = useState(0); | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<div> | ||
WebApp Count: {count} | ||
<button onClick={() => setCount(count + 1)}>Increment</button> | ||
<LibraryView /> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { useRef, useLayoutEffect } from "react"; | ||
import { Apollon2 } from "@apollon2/library"; | ||
import { useRef, useLayoutEffect } from "react" | ||
import { Apollon2 } from "@apollon2/library" | ||
|
||
export function LibraryView() { | ||
const containerRef = useRef<HTMLDivElement | null>(null); | ||
const apollon2Ref = useRef<Apollon2 | null>(null); | ||
const containerRef = useRef<HTMLDivElement | null>(null) | ||
const apollon2Ref = useRef<Apollon2 | null>(null) | ||
|
||
useLayoutEffect(() => { | ||
if (containerRef.current) { | ||
apollon2Ref.current = new Apollon2(containerRef.current); | ||
apollon2Ref.current = new Apollon2(containerRef.current) | ||
|
||
console.log( | ||
"Random number from Apollon2:", | ||
apollon2Ref.current.getRandomNumber() | ||
); | ||
) | ||
} | ||
|
||
return () => { | ||
console.log("Disposing Apollon2"); | ||
console.log("Disposing Apollon2") | ||
if (apollon2Ref.current) { | ||
apollon2Ref.current.dispose(); | ||
apollon2Ref.current = null; | ||
apollon2Ref.current.dispose() | ||
apollon2Ref.current = null | ||
} | ||
}; | ||
}, []); | ||
} | ||
}, []) | ||
|
||
return <div ref={containerRef} />; | ||
return <div ref={containerRef} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import App from "./App.tsx"; | ||
import { StrictMode } from "react" | ||
import { createRoot } from "react-dom/client" | ||
import App from "./App.tsx" | ||
|
||
const rootElement = document.getElementById("root"); | ||
const rootElement = document.getElementById("root") | ||
|
||
if (rootElement) { | ||
createRoot(rootElement).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode> | ||
); | ||
) | ||
} else { | ||
console.error("Root element not found"); | ||
console.error("Root element not found") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
import { defineConfig } from "vite" | ||
import react from "@vitejs/plugin-react" | ||
|
||
// https://vite.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react()], | ||
}); | ||
}) |