Skip to content

Conversation

@IDisposable
Copy link
Contributor

@IDisposable IDisposable commented Nov 11, 2025

Summary

Upgraded all the ESLint and enforced the current rule set to get consistent code style across the UI codebase. It primarily consists of changes automatically applied by ESLint and Prettier.

  • Enforces consistent code style: Applies a comprehensive lint fix pass to adhere to updated ESLint rules and the current Vite project build structure.
  • Improves readability: Reorders Tailwind CSS classes for consistency and makes minor adjustments to whitespace and code structure.
  • No functional changes: These modifications are purely stylistic and do not alter the behavior or functionality of the application.

Details

  • Created a new Vite project with all the required packages and synched up the structure
  • Move the eslint.config.cjs to eslint.config.js as this was the only .cjs file in the whole system
  • Follow the current vite practice of split tsconfig.json into tsconfig.app.json and tsconfig.node.json
  • Added lint:only and lint:fixonly when no localization needs compiling
  • Eliminated unused lodash.throttle package
  • Moved the eslint-import-resolver-alias to the devDependences
  • Add missing typescript-eslint to devDependencies
  • Don't force blank lines between import groups (but allow them)
  • Allow slightly longer lines
  • Upgraded to Node 22.21.1 (current for LTS 22)
  • Upgraded packages as of 2025-12-09Z2000 (except zustand)
Package From To Notes
framer-motion 12.23.24 12.23.25
lodash.throttle 4.1.1 deleted Was not referenced
react 19.2.0 19.2.1
react-dom 19.2.0 19.2.1
react-hook-form 7.66.0 7.68.0
react-router 7.9.5 7.10.1
react-simple-keyboard 3.8.132 3.8.141
recharts 3.3.0 3.5.1
tailwind-merge 3.3.1 3.4.0
validator 13.15.20 13.15.23
@eslint/compat 1.4.1 2.0.0
@eslint/eslintrc 3.3.1 3.3.3
@inlang/paraglide-js 2.5.0 2.6.0
@types/react 19.2.3 19.2.7
@types/react-dom 19.2.2 19.2.3
@types/validator 13.15.4 13.15.10
@typescript-eslint/eslint-plugin 8.46.3 8.49.0
@typescript-eslint/parser 8.46.3 8.49.0
@vitejs/plugin-react-swc 4.2.1 4.2.2
autoprefixer 10.4.21 10.4.22
eslint-import-resolver-alias 1.1.2 1.1.2 Moved to devDependencies
prettier 3.6.2 3.7.4
prettier-plugin-tailwindcss 0.7.1 0.7.2
typescript-eslint added 8.49.0 was missing
vite 7.1.12 7.2.7

@IDisposable
Copy link
Contributor Author

This changes everything ;) It was just a run of npm run lint:fix after all the package cleanup (pulling in vite 7.2.2 made a lot of things complain in eslint).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR applies ESLint and Prettier formatting rules across the UI codebase, following current Vite project standards. The changes include splitting the TypeScript configuration into separate app and node configs, upgrading Node to 22.21.1, updating several packages, removing unused dependencies, and applying consistent code formatting (quote styles, spacing, line breaks, trailing commas). The changes are purely stylistic with no intended functional modifications.

Reviewed Changes

Copilot reviewed 125 out of 130 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/tsconfig.json Restructured to reference split configs
ui/tsconfig.app.json New file with app-specific TypeScript config
ui/tsconfig.node.json Enhanced with additional compiler options
ui/src/**/*.ts(x) Applied consistent formatting: spacing, quotes, line breaks, trailing commas
ui/src/keyboardLayouts/*.ts Standardized semicolons and trailing commas

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IDisposable IDisposable requested review from adamshiervani and ym and removed request for adamshiervani November 11, 2025 23:36
@IDisposable
Copy link
Contributor Author

This one-time pass will enable us to put the eslint check that PR #491 was attempting to enable :)

@IDisposable IDisposable force-pushed the chore/es-lint-redux branch 3 times, most recently from 2cc6626 to c56eb84 Compare November 20, 2025 03:52
@IDisposable
Copy link
Contributor Author

Rebased on current dev and conflicts resolved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 126 out of 131 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IDisposable
Copy link
Contributor Author

Rebased

@adamshiervani
Copy link
Contributor

I'd rebase it myself and merge it, but it's on your write protected fork. Could you either give me write permission, so I can rebase it or, rebase it yourself. I promise i'll merge this as soon as you're done. Would love to have this in the codebase <3

@IDisposable
Copy link
Contributor Author

IDisposable commented Dec 9, 2025

Merged. but I want to do one more pass ... please hold.

READY TO MERGE @adamshiervani

Move from .cjs to .js file for eslint
Allow slightly longer lines
Don't force blank lines between import groups (but allow them)
Added lint:only and lint:fixonly when no localization needs compiling
Eliminated  unused lodash.throttle package.
Moved the eslint-import-resolver-alias to the devDependences
Add missing typescript-eslint to devDependencies
Model the split tsconfig*.json for modern vite projects.
Upgraded packages.
Bumped devcontainer
Bump more packages
Fix merge issue.
Final prettier violations cleanup
@IDisposable
Copy link
Contributor Author

The only thing that still looks wrong-ish is

/workspaces/kvm/ui/src/routes/devices.$id.settings.network.tsx
  320:20  warning  Compilation Skipped: Use of incompatible library

This API returns functions which cannot be memoized without leading to stale UI. To prevent this, by default React Compiler will skip memoizing this component/hook. However, you may see issues if values from this API are passed to other components/hooks that are memoized.

/workspaces/kvm/ui/src/routes/devices.$id.settings.network.tsx:320:20
  318 |   );
  319 |
> 320 |   const ipv4mode = watch("ipv4_mode");
      |                    ^^^^^ React Hook Form's `useForm()` API returns a `watch()` function which cannot be memoized safely.
  321 |   const ipv6mode = watch("ipv6_mode");
  322 |
  323 |   const onDhcpLeaseRenew = () => {  react-hooks/incompatible-library

✖ 1 problem (0 errors, 1 warning)

@adamshiervani
Copy link
Contributor

That should be able to be fixed by moving to useWatch() - https://react-hook-form.com/docs/usewatch.

For some more context: https://github.com/orgs/react-hook-form/discussions/7558#discussioncomment-1982479

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.

3 participants