Skip to content

refactor: use const instead of var in fc-date-picker - #129

Merged
scardanzan merged 1 commit into
masterfrom
refactor/use-const-instead-of-var
Nov 27, 2026
Merged

scardanzan merged 1 commit into
masterfrom
refactor/use-const-instead-of-var

Conversation

@paodb

@paodb paodb commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Replace the two var calendar declarations in fc-date-picker.js with const, since the variable is never reassigned.

Close #126

Summary by CodeRabbit

  • Chores
    • This update contains an internal cleanup only. There are no changes to the date picker’s visible behavior or functionality.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3dfb3fa-349a-49a2-8c29-30b73d17ca11

No actionable comments were generated in the recent review.

Walkthrough

Both _createElement wrappers in fc-date-picker.js now declare the local calendar element with const. The remaining logic is unchanged.

Changes

Calendar declaration cleanup

Layer / File(s) Summary
Update calendar declarations
src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js
The overlay-renderer and opened-changed wrappers change the local calendar declaration from var to const.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Refactor

Suggested reviewers: javier-godoy

Merge Risk: Minimal · previous review 7d19b

This is a small refactor that replaces var with const for two local variables that are never reassigned. No behavior change or user impact is expected, and it is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor: use const instead of var in fc-date-picker" matches the changeset. The PR changes the two var calendar declarations in the _createElement wrappers of fc-date-picker.js to `con…
Linked Issues check Passed Issue #126 requires replacing the var calendar = createElement(); declarations in fc-date-picker.js with let or const. The reviewed head file (src/main/resources/META-INF/frontend/fc-date-picker…
Out of Scope Changes check Passed The whole-PR summary (merge base 8de8ee6 to head 7d19bca) reports a +2/-2 change in one file, fc-date-picker.js. The two changed lines replace var with const on the calendar declarations named i…
Full details: Title check

Explanation

The title "refactor: use const instead of var in fc-date-picker" matches the changeset. The PR changes the two var calendar declarations in the _createElement wrappers of fc-date-picker.js to const, which is the main change. The title is specific and concise, and it follows a conventional commit style. The title does not need to mention the linked issue or the unchanged behavior.

Full details: Linked Issues check

Explanation

Issue #126 requires replacing the var calendar = createElement(); declarations in fc-date-picker.js with let or const. The reviewed head file (src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js) declares const calendar = createElement(); in both _createElement wrappers: the one in the renderer branch and the one in the opened-changed branch. No var calendar declaration remains in the reviewed head file. Neither wrapper reassigns calendar, so const is valid. The issue has no other coding requirements. Its references to #106 and #104 are background only. No automated tests are required by the issue, and none are added or needed for this change.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary (merge base 8de8ee6 to head 7d19bca) reports a +2/-2 change in one file, fc-date-picker.js. The two changed lines replace var with const on the calendar declarations named in #126. The event listeners, style updates, and return values are unchanged. No unrelated changes were reported. A text diff could not be read because the changed blobs are missing from the checkout. The head file contents were read directly and are consistent with the summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38895128-224c-49d9-9ef8-6eb0bcaa3f22
Commits

Reviewing files that changed from the base of the PR and between 8de8ee6 and 7d19bca.

Files selected for processing: 1

  • src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@paodb
paodb marked this pull request as ready for review November 16, 2026 17:16
@paodb
paodb requested a review from scardanzan November 16, 2026 17:16
@scardanzan
scardanzan force-pushed the refactor/use-const-instead-of-var branch from 7d19bca to 187a68b Compare November 27, 2026 18:51
@sonarqubecloud

Copy link
Copy Markdown

@scardanzan
scardanzan merged commit 0c6754f into master Nov 27, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Nov 27, 2026
@scardanzan
scardanzan deleted the refactor/use-const-instead-of-var branch November 27, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

refactor: unexpected var, use let or const instead

2 participants