Skip to content

Chore/eslint prettier config - #46

Merged
cdenig merged 5 commits into
fix-multiple-debug-messagesfrom
chore/eslint-prettier-config
Sep 23, 2026
Merged

cdenig merged 5 commits into
fix-multiple-debug-messagesfrom
chore/eslint-prettier-config

Conversation

@cdenig

@cdenig cdenig commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds ESLint and Prettier configuration so the linting and formatting tools we reference in the README and VS Code settings actually run.

Stacked on fix-multiple-debug-messages. Merge that PR first, or review this one against that branch.

Changes

Tooling (2746970)

  • eslint.config.js (flat config, ESLint 10):
    • @eslint/js and typescript-eslint recommended rules
    • eslint-plugin-react-hooks and eslint-plugin-react-refresh (Vite)
    • Type-aware no-floating-promises and no-misused-promises, which catch unhandled async errors
    • eslint-config-prettier last, so ESLint and Prettier don't conflict
  • Renamed prettierrc.json to .prettierrc.json. Without the leading dot, Prettier never found it. The existing settings (single quotes, trailingComma: es5) are unchanged.
  • New scripts: lint, lint:fix, format, format:check

Formatting (240c88c, a1bcd0d)

  • One-time npm run format across the repo, including docs/. It changes formatting only, not code.
  • That commit is listed in .git-blame-ignore-revs, so git blame skips it.

Lint fixes (1bce11f)

  • Behavior change: join() now catches and logs a failed debug-session start. Before, it left an unhandled promise rejection.
  • RTK Query triggers, refetch() and navigate() that aren't awaited are now marked with void. Their promises don't reject unless .unwrap() is called.
  • Async onClick/onSubmit handlers are wrapped so React receives a function that returns nothing.
  • Replaced any with unknown, or with a narrow type for Monaco's legacy languages.json API.
  • Removed the unused getAppIdFromPath, changed String to string in LogMessage, and renamed icons/index.tsx to .ts because it contains no components.

Editor (b47b411)

  • .vscode/settings.json: removed ESLint settings from the old config format. eslint.options.extensions is no longer supported in ESLint 10, and the old eslint.validate list left out .tsx files.
  • Prettier is now the default formatter, with format-on-save turned on.
  • Added .vscode/extensions.json, which recommends the ESLint and Prettier extensions.
  • The README now documents the new scripts.

Not included

  • 5 warnings remain on purpose: four for setting state inside effects (react-hooks/set-state-in-effect) and one missing hook dependency (react-hooks/exhaustive-deps), in Routing.tsx and the shared filter components. The fixes aren't mechanical, so they'll go in a follow-up PR.
  • eslint-plugin-react and eslint-plugin-jsx-a11y are left out because they don't support ESLint 10 yet.
  • CI doesn't run lint or format:check yet.

Testing

  • npm run lint: 0 errors, 5 warnings (the intended ones above)
  • npm run format:check: clean
  • tsc -b: clean
  • vitest run: 19/19 passing

Reviewer notes

  • Review the formatting commit 240c88c separately, or skip it. The other commits are small.
  • Locally, run git config blame.ignoreRevsFile .git-blame-ignore-revs once. GitHub already applies the file.

cdenig and others added 5 commits September 23, 2026 14:13
- 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>
@cdenig cdenig self-assigned this Sep 23, 2026
@cdenig
cdenig requested a lite review from Copilot September 23, 2026 18:24
@cdenig
cdenig merged commit bcf3a41 into fix-multiple-debug-messages Sep 23, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 1 Low severity

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.

Comment thread package.json
@@ -39,8 +44,14 @@
"@types/react-scroll-to-bottom": "^4.2.5",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^10.11.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the documented minimum

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/tutorials/device-management-basics.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants