Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces repository-wide ESLint + Prettier configuration (with root scripts) and applies an initial formatting baseline across the monorepo (web/client/senatus/executioner/lib).
Changes:
- Add root-level ESLint (flat config) + Prettier configuration and lint-staged setup.
- Add root scripts for install/dev/build/lint/format workflows across packages.
- Apply Prettier-driven formatting and some small typing/cleanup tweaks across multiple packages.
Reviewed changes
Copilot reviewed 84 out of 92 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| web/vite.config.ts | Prettier formatting (semicolons/quotes). |
| web/tailwind.config.js | Switch Tailwind plugins to imports + formatted config. |
| web/src/vite-env.d.ts | Add semicolons / formatting. |
| web/src/types.ts | Add shared Language type. |
| web/src/pages/RegisterPage.tsx | Import formatting / whitespace cleanup. |
| web/src/pages/LoginPage.tsx | Import formatting / whitespace cleanup. |
| web/src/pages/EventsPage.tsx | Replace any with unknown/Language, formatting, extract EmptyState. |
| web/src/pages/EventDetailPage.tsx | Replace any with unknown/Language, formatting. |
| web/src/pages/CompetePage.tsx | Reduce any usage, refactor submission fetch with useCallback, formatting. |
| web/src/main.tsx | Prettier trailing comma formatting. |
| web/src/lib/utils.ts | Quote/semicolon formatting. |
| web/src/contexts/AuthContext.tsx | Refactor initial user load to useState initializer; remove effect import. |
| web/src/components/ui/use-toast.ts | Prettier formatting + action type refactor. |
| web/src/components/ui/toaster.tsx | Prettier formatting. |
| web/src/components/ui/toast.tsx | Prettier formatting. |
| web/src/components/ui/tabs.tsx | Prettier formatting. |
| web/src/components/ui/table.tsx | Prettier formatting / minor refactor to single-line exports. |
| web/src/components/ui/separator.tsx | Prettier formatting. |
| web/src/components/ui/select.tsx | Prettier formatting. |
| web/src/components/ui/label.tsx | Prettier formatting. |
| web/src/components/ui/input.tsx | Convert InputProps to type alias + formatting. |
| web/src/components/ui/dropdown-menu.tsx | Prettier formatting. |
| web/src/components/ui/card.tsx | Prettier formatting / minor refactor. |
| web/src/components/ui/button.tsx | Prettier formatting / minor refactor. |
| web/src/components/ui/badge.tsx | Prettier formatting / minor refactor. |
| web/src/components/ui/avatar.tsx | Prettier formatting. |
| web/src/components/Layout.tsx | Import formatting and whitespace cleanup. |
| web/src/App.tsx | Whitespace cleanup. |
| web/README.md | Minor formatting adjustment. |
| web/postcss.config.js | Add trailing semicolon / formatting. |
| web/eslint.config.js | Remove per-package ESLint config (moved to root). |
| web/codegen.ts | Prettier formatting. |
| SETUP.md | Trailing whitespace cleanup. |
| senatus/tsconfig.json | Compact include list formatting. |
| senatus/src/index.ts | Improve typing for Strapi bootstrap + formatting. |
| senatus/src/api/test-case/controllers/test-case.ts | Prettier formatting. |
| senatus/src/api/submission/routes/0-submit.ts | Remove leading blank line + formatting. |
| senatus/src/api/submission/controllers/submission.ts | Add validation + formatting changes in submit/execution endpoints. |
| senatus/src/api/problem/documentation/1.0.0/problem.json | JSON formatting baseline. |
| senatus/src/api/problem/controllers/problem.ts | Prettier formatting. |
| senatus/src/api/language/documentation/1.0.0/language.json | JSON formatting baseline. |
| senatus/src/api/language/controllers/language.ts | Prettier formatting. |
| senatus/src/api/execution/controllers/execution.ts | Prettier formatting. |
| senatus/src/api/event/documentation/1.0.0/event.json | JSON formatting baseline. |
| senatus/src/api/event/controllers/event.ts | Prettier formatting. |
| senatus/src/admin/tsconfig.json | Compact include/exclude formatting. |
| senatus/config/server.ts | Formatting / remove inline comment. |
| senatus/config/plugin.ts | Remove unused env param + formatting. |
| senatus/config/database.ts | Formatting / trailing commas. |
| README.md | Markdown list formatting baseline. |
| prettier.config.mjs | Add repo-wide Prettier config. |
| package.json | Add root scripts + devDependencies + engines. |
| lint-staged.config.mjs | Add lint-staged config for eslint/prettier. |
| lib/queue/tsconfig.json | Formatting and minor JSON adjustments. |
| lib/queue/src/amqp.ts | Formatting + minor typing cleanup. |
| executioner/runtimes/languages/nodejs/tsconfig.json | Inline-comment formatting tweaks. |
| executioner/languages/docker.ts | Reduce any, formatting, small refactor. |
| executioner/index.ts | Formatting and small refactor. |
| eslint.config.mjs | Add root flat ESLint config with ignores + per-package overrides. |
| DOCUMENTATION.md | Markdown whitespace / formatting baseline. |
| docker-compose.q.yml | YAML indentation normalization. |
| client/src/theme/index.ts | TS formatting baseline. |
| client/src/pages/Compete/SubmissionStatus.tsx | Formatting baseline. |
| client/src/pages/Compete/Submissions/SubmissionsTable.tsx | Formatting baseline. |
| client/src/pages/Compete/Submissions/SubmissionPreview.tsx | Formatting baseline. |
| client/src/pages/Compete/Submissions/index.tsx | Formatting baseline. |
| client/src/pages/Compete/SampleTestCases.tsx | Formatting baseline. |
| client/src/pages/Compete/Problem/index.tsx | Formatting baseline. |
| client/src/pages/Compete/Problem/CodeEditorPane.tsx | Formatting baseline. |
| client/src/pages/Compete/InfoTabs.tsx | Formatting baseline. |
| client/src/pages/Compete/index.tsx | Formatting baseline. |
| client/src/pages/Compete/CompeteTabs.tsx | Formatting baseline. |
| client/src/index.tsx | Formatting baseline. |
| client/src/index.css | Minor formatting/no-op. |
| client/src/data/useGetProblem.tsx | GraphQL query formatting + minor cleanup. |
| client/src/data/useGetAllEvents.tsx | GraphQL query formatting + minor cleanup. |
| client/src/data/schema.ts | Prettier formatting / readability tweak. |
| client/src/components/PageLayout.tsx | Formatting baseline. |
| client/src/components/LanguageSelect.tsx | Formatting baseline. |
| client/src/components/Header.tsx | Formatting baseline. |
| client/src/components/EmptySectionPlaceholder.tsx | Formatting baseline. |
| client/src/components/CodeEditor.tsx | Formatting baseline. |
| client/src/App.tsx | Import formatting baseline. |
| client/README.md | Remove trailing blank line. |
| client/codegen.ts | Prettier formatting. |
| client/.eslintrc.yml | YAML formatting refactor. |
| client/.eslintrc.cjs | Prettier formatting. |
| .prettierignore | Add repo-wide ignore patterns. |
| .github/workflows/build.yml | Whitespace cleanup. |
| .github/pull_request_template.md | Markdown formatting tweak. |
| .editorconfig | Add editor defaults to match Prettier baseline. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /*useEffect(() => { | ||
| // Check if user is already logged in | ||
| const token = localStorage.getItem("jwt"); | ||
| const storedUser = localStorage.getItem("user"); | ||
|
|
||
| if (token && storedUser) { | ||
| setUser(JSON.parse(storedUser)); | ||
| } | ||
| setIsLoading(false); | ||
| }, []); | ||
| }, []);*/ |
| ## 📋 Prerequisites | ||
|
|
||
| - Node.js 18+ | ||
| - Node.js 18+ |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 84 out of 92 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
.prettierignore:31
- The last line
cleardoesn’t match any file/path in the repo and will cause Prettier to ignore a non-existent pattern. It looks like an accidental leftover and should be removed (or commented out) to avoid confusion.
web/src/contexts/AuthContext.tsx:43 - There is a large commented-out
useEffectblock that referencessetIsLoading(which no longer exists) and uses a different quoting style. Keeping dead code like this makes the auth bootstrap logic harder to maintain and can confuse future changes.
| const pollSubmissions = async () => { | ||
| await fetchSubmissions(); | ||
|
|
||
| // Check if all done and show toast | ||
| const updatedHasUnprocessed = submissions.some(sub => | ||
| sub.executions?.some(exec => !exec.processed) | ||
| const updatedHasUnprocessed = submissions.some((sub) => | ||
| sub.executions?.some((exec) => !exec.processed), | ||
| ); |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 84 out of 92 changed files in this pull request and generated 1 comment.
Suppressed comments (6)
Previously missed (1) — in code that hasn't changed since the last review.
web/src/pages/CompetePage.tsx:16
- To reuse the shared Language type (see web/src/types.ts) and the updated local interface extending BaseLanguage, add a type-only import for it in this file.
This issue also appears on line 41 of the same file.
web/src/contexts/AuthContext.tsx:43
- Remove the commented-out useEffect block. It references setIsLoading/useEffect that no longer exist in the file and will confuse future edits; the current implementation already initializes auth state synchronously via the useState initializer.
web/src/pages/CompetePage.tsx:87 - Polling logic relies on the latest submissions after fetchSubmissions(), but the state update is async. Track the latest fetched submissions in a ref so pollSubmissions can use fresh data immediately after the fetch completes.
web/src/pages/CompetePage.tsx:107 - Keep submissionsRef in sync when new submissions are fetched; otherwise pollSubmissions may still evaluate stale data even after awaiting fetchSubmissions().
web/src/pages/CompetePage.tsx:217 - pollSubmissions() checks completion using the
submissionsstate value, which is stale right after awaiting fetchSubmissions() (React state updates are async). Use the ref updated during fetchSubmissions() so the completion check/toast is based on the freshest data.
web/src/pages/CompetePage.tsx:45 - Avoid duplicating the base Language shape. Reuse the shared type and extend it with CompetePage-specific fields (codeName).
| return async () => { | ||
| if (consumers.indexOf(sub) === -1) { | ||
| consumers.splice(consumers.indexOf(sub), 1); | ||
| } | ||
| await sub.close(); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
If the .d.ts files are build artifacts created by a tool or compiler, do not commit them.
| "devDependencies": { | ||
| "@types/dockerode": "^3.3.24", | ||
| "@types/uuid": "^9.0.8", | ||
| "bun-types": "latest", | ||
| "tsx": "^4.7.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "typescript": "^5.0.0" | ||
| "tsx": "^4.7.1", | ||
| "typescript": "6.0.3" |
There was a problem hiding this comment.
question: Is this a library/package that specifically requires the consuming project to provide TypeScript, or is this is an application?
If this is the first thing then it should be a peerDependency, if not then this is okay.
| "typecheck:web": "tsc --noEmit -p web/tsconfig.json", | ||
| "typecheck:senatus": "tsc --noEmit -p senatus/tsconfig.json", | ||
| "typecheck:executioner": "tsc --noEmit -p executioner/tsconfig.json", | ||
| "typecheck:queue": "tsc --noEmit -p lib/queue/tsconfig.json", |
There was a problem hiding this comment.
In every package.json file inside these folders you have added this script: "typecheck": "tsc --noEmit".
In npm, a --prefix flag exists and is used to execute an npm command in a specific subdirectory rather than the current working directory. It allows you to target a nested package.json file without having to manually change directories using cd.
Use it.
| "quality": "npm run lint && npm run format:check && npm run typecheck", | ||
| "quality:strict": "npm run lint:strict && npm run format:check && npm run typecheck", |
There was a problem hiding this comment.
Not quite a good name. A better name would be validate -> since when you read it npm run validate; it's clear that you are validating the project.
Issue ID
#107
What has been done?