Skip to content

Use new const keyword#32

Merged
ryanlua merged 3 commits intomainfrom
const-keyword
Mar 30, 2026
Merged

Use new const keyword#32
ryanlua merged 3 commits intomainfrom
const-keyword

Conversation

@ryanlua
Copy link
Copy Markdown
Owner

@ryanlua ryanlua commented Mar 30, 2026

Converts usage of local to const when necessary.

ryanlua added 3 commits March 30, 2026 03:00
Blindly convert local to const keywords

Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Copilot AI review requested due to automatic review settings March 30, 2026 07:41
Copy link
Copy Markdown
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 updates the codebase to use Luau’s const declarations in places where bindings are not intended to be reassigned, aligning implementation files and docs examples with that immutability intent.

Changes:

  • Replaced local with const for module/service references and other single-assignment bindings in several client scripts.
  • Updated local function examples/usages in a client script and documentation snippets to const function.
  • Updated the API reference documentation code samples to match the new const-based style.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/TopbarIcon.client.luau Converts module imports and the icon binding to const.
src/CoreGuiWarn.client.luau Converts StarterGui service binding to const.
src/ContextAction.client.luau Converts service/module/constants and the action handler declaration to const.
src/Attribution.client.luau Converts service/version bindings and pcall result bindings to const.
docs/api-reference.md Updates code samples to use const (and const function) for copy-paste examples.

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

@ryanlua ryanlua merged commit 994b9ac into main Mar 30, 2026
6 of 8 checks passed
@ryanlua ryanlua deleted the const-keyword branch March 30, 2026 07:46
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