Chore/eslint prettier config - #46
Conversation
- eslint.config.js: @eslint/js + typescript-eslint recommended, React hooks, Vite react-refresh, plus type-aware no-floating-promises and no-misused-promises; eslint-config-prettier last to avoid conflicts - Rename prettierrc.json to .prettierrc.json so Prettier finds it, and add .prettierignore - Add lint, lint:fix, format and format:check scripts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No functional changes; generated by `npm run format`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub applies .git-blame-ignore-revs automatically; locally run `git config blame.ignoreRevsFile .git-blame-ignore-revs`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Log failures from join() instead of leaving an unhandled rejection when starting a debug session fails - Mark fire-and-forget RTK Query triggers, refetch() and navigate() with `void` (their promises don't reject without unwrap()) - Wrap async click/submit handlers so React gets a void callback - Replace `any` with `unknown` or a narrow type for the legacy monaco languages.json API; String -> string in LogMessage - Remove unused getAppIdFromPath; rename icons/index.tsx to .ts since it holds no components Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop legacy eslint.options.extensions (removed in ESLint 10), the prettier/prettier rule customization, html validation and the deprecated eslint.alwaysShowStatus; the default eslint.validate also covers .tsx, which the old list missed - Use Prettier as the default formatter and format on save - Recommend the ESLint and Prettier extensions - Document the lint and format scripts in the README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Align the documented Node.js requirement with ESLint 10 and restore literal wildcard examples in the documentation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds ESLint 10 and Prettier tooling, applies repository-wide formatting, and fixes lint-related promise handling and typing issues.
Changes:
- Added lint/format scripts, configuration, and VS Code recommendations.
- Formatted source code, tests, styles, documentation, and configuration.
- Fixed async handlers, unhandled promises, and unsafe types.
| File | Summary |
|---|---|
vite.config.ts |
Formatting |
tsconfig.json |
Formatting |
src/vite-env.d.ts |
Formatting |
src/styles.scss |
Formatting |
src/store/websocketSlice.ts |
Formatting |
src/store/websocketMiddleware.ts |
Formatting |
src/store/websocketMiddleware.test.ts |
Formatting |
src/store/store.ts |
Formatting |
src/store/routingFeedbackSlice.ts |
Formatting |
src/store/routingFeedbackMiddleware.ts |
Formatting |
src/store/hooks.ts |
Formatting |
src/store/commonUi/commonUiState.ts |
Formatting |
src/store/commonUi/commonUiSlice.ts |
Formatting |
src/store/commonUi/commonUiSelectors.ts |
Formatting |
src/store/commonUi/commonUiHooks.ts |
Formatting |
src/store/apiSlice.ts |
Type and promise handling cleanup |
src/shared/types/LogMessage.ts |
Type correction |
src/shared/ListFiltersHeader.tsx |
Formatting |
src/shared/icons/index.ts |
Rename and formatting |
src/shared/hooks/useAppParams.ts |
Formatting |
src/shared/functions/meetsMinimumVersion.ts |
Formatting |
src/shared/FilterSearchText.tsx |
Formatting |
src/shared/FilterDropdownSearchParams.tsx |
Formatting |
src/react-app-env.d.ts |
Formatting |
src/index.tsx |
Formatting |
src/features/Versions.tsx |
Lint fix |
src/features/Types.tsx |
Formatting |
src/features/TopNav.tsx |
Formatting |
src/features/TieLineEdge.tsx |
Formatting |
src/features/RoutingDeviceNode.tsx |
Formatting |
src/features/RequireAuth.tsx |
Formatting |
src/features/MultiviewLayoutPanel.tsx |
Formatting |
src/features/MultiviewLayoutCanvas.tsx |
Formatting |
src/features/MultiviewLayoutCanvas.module.scss |
Formatting |
src/features/MobileControl.tsx |
Async handler fixes |
src/features/MainLayout.tsx |
Formatting |
src/features/LoginForm.tsx |
Async handler fixes |
src/features/InitializationExceptions.tsx |
Formatting |
src/features/Help/HelpSidebar.tsx |
Formatting |
src/features/Help/HelpArticle.tsx |
Formatting |
src/features/Help/Help.tsx |
Formatting |
src/features/Help/Help.test.tsx |
Formatting |
src/features/Help/docsContent.ts |
Formatting |
src/features/Help/docsContent.test.ts |
Formatting |
src/features/ErrorBoundary.tsx |
Formatting |
src/features/DeviceList.tsx |
Formatting |
src/features/DeviceDetail.tsx |
Async handler and formatting fixes |
src/features/DebugConsole/RestartConfirmModal.tsx |
Formatting |
src/features/DebugConsole/MinimumLogLevelDropdown.tsx |
Promise handling |
src/features/DebugConsole/LogMessageDetailDrawer.tsx |
Formatting |
src/features/DebugConsole/DeviceFilterDropdown.tsx |
Formatting |
src/features/DebugConsole/DebugFilters.tsx |
Formatting |
src/features/DebugConsole/debugConsts.ts |
Formatting |
src/features/DebugConsole/DebugConsole.tsx |
Promise handling and formatting |
src/features/DebugConsole/ConsoleWindow.tsx |
Formatting |
src/features/ConfigFile.tsx |
Type narrowing and promise handling |
src/features/ApiPaths.tsx |
Formatting |
src/features/ApiPathDetailDrawer.tsx |
Formatting |
src/App.tsx |
Debug-session error handling |
src/App.test.tsx |
Formatting |
README.md |
Documents lint and format scripts |
package.json |
Tooling dependencies and scripts |
index.html |
Formatting |
eslint.config.js |
ESLint flat configuration |
docs/tutorials/README.md |
Formatting |
docs/tutorials/getting-started.md |
Formatting |
docs/tutorials/device-management-basics.md |
Formatting and documentation update |
docs/tutorials/debug-console-basics.md |
Formatting |
docs/reference/README.md |
Formatting |
docs/reference/configuration-schema.md |
Formatting |
docs/README.md |
Formatting |
docs/how-to/troubleshoot-connection.md |
Formatting |
docs/how-to/trace-signal-routes.md |
Formatting |
docs/how-to/restart-reload-config.md |
Formatting |
docs/how-to/README.md |
Formatting |
docs/how-to/monitor-performance.md |
Formatting |
docs/how-to/filter-debug-messages.md |
Formatting |
docs/how-to/export-configuration.md |
Formatting |
docs/explanation/README.md |
Formatting |
docs/explanation/debug-console-design.md |
Formatting |
docs/explanation/configuration-management.md |
Formatting |
docs/explanation/architecture.md |
Formatting |
.vscode/snippets.code-snippets |
Formatting |
.vscode/settings.json |
Editor tooling configuration |
.vscode/launch.json |
Formatting |
.vscode/extensions.json |
Extension recommendations |
.releaserc.json |
Formatting |
.prettierrc.json |
Prettier configuration |
.prettierignore |
Formatting exclusions |
.git-blame-ignore-revs |
Ignores bulk formatting revision |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -39,8 +44,14 @@ | |||
| "@types/react-scroll-to-bottom": "^4.2.5", | |||
| "@vitejs/plugin-react": "^6.0.1", | |||
| "eslint": "^10.11.0", | |||
There was a problem hiding this comment.
please update the documented minimum
There was a problem hiding this comment.
Good catch. Node 18 was actually already unsupported by Vite 8 and jsdom 29, and ESLint 10 needs the same range. I updated the README prerequisite to Node 20.19+/22.13+/24+ and added a matching engines field to package.json (c0bd097). CI already uses Node 22.


Summary
Adds ESLint and Prettier configuration so the linting and formatting tools we reference in the README and VS Code settings actually run.
Changes
Tooling (
2746970)eslint.config.js(flat config, ESLint 10):@eslint/jsandtypescript-eslintrecommended ruleseslint-plugin-react-hooksandeslint-plugin-react-refresh(Vite)no-floating-promisesandno-misused-promises, which catch unhandled async errorseslint-config-prettierlast, so ESLint and Prettier don't conflictprettierrc.jsonto.prettierrc.json. Without the leading dot, Prettier never found it. The existing settings (single quotes,trailingComma: es5) are unchanged.lint,lint:fix,format,format:checkFormatting (
240c88c,a1bcd0d)npm run formatacross the repo, includingdocs/. It changes formatting only, not code..git-blame-ignore-revs, sogit blameskips it.Lint fixes (
1bce11f)join()now catches and logs a failed debug-session start. Before, it left an unhandled promise rejection.refetch()andnavigate()that aren't awaited are now marked withvoid. Their promises don't reject unless.unwrap()is called.onClick/onSubmithandlers are wrapped so React receives a function that returns nothing.anywithunknown, or with a narrow type for Monaco's legacylanguages.jsonAPI.getAppIdFromPath, changedStringtostringinLogMessage, and renamedicons/index.tsxto.tsbecause it contains no components.Editor (
b47b411).vscode/settings.json: removed ESLint settings from the old config format.eslint.options.extensionsis no longer supported in ESLint 10, and the oldeslint.validatelist left out.tsxfiles..vscode/extensions.json, which recommends the ESLint and Prettier extensions.Not included
react-hooks/set-state-in-effect) and one missing hook dependency (react-hooks/exhaustive-deps), inRouting.tsxand the shared filter components. The fixes aren't mechanical, so they'll go in a follow-up PR.eslint-plugin-reactandeslint-plugin-jsx-a11yare left out because they don't support ESLint 10 yet.lintorformat:checkyet.Testing
npm run lint: 0 errors, 5 warnings (the intended ones above)npm run format:check: cleantsc -b: cleanvitest run: 19/19 passingReviewer notes
240c88cseparately, or skip it. The other commits are small.git config blame.ignoreRevsFile .git-blame-ignore-revsonce. GitHub already applies the file.