Skip to content

refactor: convert shared form helpers and components to TypeScript (CM-1579) - #4902

Merged
gaspergrom merged 4 commits into
mainfrom
refactor/CM-1579-shared-form-ts
Oct 9, 2026
Merged

gaspergrom merged 4 commits into
mainfrom
refactor/CM-1579-shared-form-ts

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Converts the shared form helpers and components (element-change, form-change, form-errors, form-item, inline-select-input, array-input) to TypeScript. The type-check baseline drops from 538 to 536.

  • The six files leave .eslint/legacy-files.json.

JIRA: https://linuxfoundation.atlassian.net/browse/CM-1579

…M-1579)

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 09:23
@cursor

cursor Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Type-only and Vue API modernization on shared form UI; behavior should match aside from minor defaults (e.g. empty options array).

Overview
Migrates six shared form pieces—array-input, form-errors, form-item, inline-select-input, element-change, and form-change—to TypeScript with <script setup lang="ts">, defineOptions, and typed props, emits, and slots (including Vuelidate ErrorObject on error UI).

form-change moves from .js to .ts with explicit return types; inline-select-input gains an InlineSelectOption interface and defaults options to an empty array instead of {}. Legacy ESLint exemptions for these paths are removed, and the typecheck baseline drops from 538 to 534 errors.

Reviewed by Cursor Bugbot for commit 436e735. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

🟡 Changes recommended

CI reports 534 type errors, so the baseline of 536 would permit two regressions.

1 open finding
What changed in this PR

Converts shared Vue form utilities and components to TypeScript while removing their ESLint legacy exemptions.

Changes:

  • Adds typed props, emits, slots, and Vuelidate errors.
  • Converts form-change.js to TypeScript.
  • Updates ESLint exemptions and the type-check baseline.
File Description
frontend/​typecheck-baseline.json Lowers the type-error baseline.
frontend/​.eslint/​legacy-files.json Removes converted components from legacy exemptions.
frontend/​src/​shared/​form/​array-input.vue Adds TypeScript component definitions.
frontend/​src/​shared/​form/​element-change.ts Types the element change detector.
frontend/​src/​shared/​form/​form-change.js Removes the JavaScript implementation.
frontend/​src/​shared/​form/​form-change.ts Adds the typed replacement implementation.
frontend/​src/​shared/​form/​form-errors.vue Types validation errors and messages.
frontend/​src/​shared/​form/​form-item.vue Types props, slots, and validation handling.
frontend/​src/​shared/​form/​inline-select-input.vue Types options, props, and emitted events.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/typecheck-baseline.json Outdated
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom
gaspergrom requested review from epipav and themarolt and a balanced review from Copilot October 9, 2026 09:39

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.

🟢 Approval recommended

The TypeScript migration preserves existing behavior and the previously reported baseline mismatch is resolved.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@themarolt themarolt 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.

lgtm

@gaspergrom
gaspergrom merged commit 2e11d53 into main Oct 9, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the refactor/CM-1579-shared-form-ts branch October 9, 2026 10:06
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