Skip to content

refactor(web): use arrow functions and enforce func-style#18

Merged
Bugs5382 merged 1 commit into
mainfrom
refactor/17-arrow-functions
Jul 6, 2026
Merged

refactor(web): use arrow functions and enforce func-style#18
Bugs5382 merged 1 commit into
mainfrom
refactor/17-arrow-functions

Conversation

@Bugs5382

@Bugs5382 Bugs5382 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What and why

Standardize function definitions across the Fleet Manager UI on arrow-function expressions and enforce the style with ESLint, so the codebase stays consistent and aligns with @the-rabbit-hole/eslint-config (which now ships func-style: ["error", "expression"]).

43 function declarations across 20 files in src/ were converted to const-assigned arrow functions: React components, context providers/hooks (ThemeProvider/useTheme, AuthProvider/useAuth), module helpers, and test helpers. In src/lib/mock.ts, issuingFanOut was moved above mockNodes to avoid a temporal-dead-zone error now that it is a const. No JSX, styles, logic, or Apache headers changed. func-style: ["error", "expression"] was added to eslint.config.js.

Closes #17

Verification

  • Lint clean
  • Tests pass
  • Build succeeds

How this was verified

  • npm run build (tsc -b && vite build) — clean
  • npm run lint (eslint . && prettier --check .) — clean; 0 function declarations remain in src/
  • npm test (vitest run) — 7 passed / 3 files
  • task license — 0/36 changed

Convert every function declaration in src/ to a const-assigned arrow
function: React components, hooks, module helpers, and test helpers.
The issuingFanOut fixture builder is moved above mockNodes so the const
is initialized before the module-level array that spreads it.

Add the func-style ESLint rule (expression) so any future function
declaration fails lint. Behavior, markup, styles, and logic are
unchanged.
@Bugs5382 Bugs5382 self-assigned this Jul 6, 2026
@github-actions github-actions Bot added the refactor Internal change / refactor. label Jul 6, 2026
@Bugs5382

Bugs5382 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Converted 43 function declarations across 20 src/ files to arrow functions (components, providers/hooks, helpers, test helpers); moved issuingFanOut above mockNodes in src/lib/mock.ts to avoid a TDZ error; added func-style: ["error", "expression"] to eslint.config.js. No behavior or markup changes. Verified locally: build clean, eslint + prettier clean (0 function declarations remain in src/), 7 tests pass, license 0/36 changed. All CI checks green.

@Bugs5382
Bugs5382 merged commit ea3ca0f into main Jul 6, 2026
12 checks passed
@Bugs5382
Bugs5382 deleted the refactor/17-arrow-functions branch July 6, 2026 21:17
@Bugs5382 Bugs5382 added this to the v1.0.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Internal change / refactor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(web): use arrow functions and enforce func-style

1 participant