Conversation
|
|
||
| useEffect(() => { | ||
| fetch("http://localhost:5000/") | ||
| .then((res) => res.text()) |
Check failure
Code scanning / ESLint
Require any function or method that returns a Promise to be marked async Error
| fetch("http://localhost:5000/") | ||
| .then((res) => res.text()) | ||
| .then(setMessage) | ||
| .catch((e) => { |
Check failure
Code scanning / ESLint
Enforce typing arguments in Promise rejection callbacks as `unknown` Error
| const interval = setInterval(async () => { | ||
| try { | ||
| const res = await fetch("http://localhost:4590/"); | ||
| const text = await res.text(); | ||
| setMessage(text); | ||
| setRobotOnline(text.includes("Welcome")); | ||
| } catch { | ||
| setRobotOnline(false); | ||
| } | ||
| }, 2000); |
Check failure
Code scanning / ESLint
Disallow Promises in places not designed to handle them Error
|
|
||
| const app = express(); | ||
| const port = 5000; | ||
| app.use(cors()); |
Check warning
Code scanning / ESLint
Disallow calling a value with type `any` Warning
| import "./App.css"; | ||
| import LimelightTable from "./LimelightTable"; | ||
|
|
||
| function App() { |
Check warning
Code scanning / ESLint
Require explicit return and argument types on exported functions' and classes' public class methods Warning
| import './index.css' | ||
| import App from './App' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( |
Check warning
Code scanning / ESLint
Disallow non-null assertions using the `!` postfix operator Warning
| import './index.css' | ||
| import App from './App' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( |
Check warning
Code scanning / ESLint
Disallow non-null assertions using the `!` postfix operator Warning
| function createSessionFolder(): string { | ||
| if (!fs.existsSync(USB_ROOT)) { | ||
| throw new Error("USB drive not connected"); | ||
| } | ||
|
|
||
| const timestamp = new Date().toISOString().replace(/[:.]/g, "-"); | ||
| const sessionDir = path.join(USB_ROOT, `recording-${timestamp}`); | ||
|
|
||
| fs.mkdirSync(sessionDir, { recursive: true }); | ||
| return sessionDir; | ||
| } |
There was a problem hiding this comment.
consider moving this too
There was a problem hiding this comment.
that goes with the whole finding where to save videos thing
| class RecordingProcess { | ||
| public ffmpegProcess: ChildProcess | null = null; | ||
| public cameraUrl: string; | ||
| public outputFile: string; | ||
|
|
||
| // --- CONSTRUCTOR --- | ||
| public constructor(cameraUrl: string, outputFile: string) { | ||
| const time: Date = new Date(); | ||
| this.outputFile = outputFile | ||
| + "/timestamp_" | ||
| + time.getHours() | ||
| + ":" | ||
| + time.getMinutes() | ||
| + ".mp4"; | ||
|
|
There was a problem hiding this comment.
don't use classes if u can (backed by yoni)
No description provided.