StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

Fix sort_requires not recognizing `const` imports in luau

Open ddashdev opened this issue 6 months ago • 1 comments

Problem

sort_requires only recognized imports parsed as Stmt::LocalAssignment, so Luau imports declared with the new const keyword were ignored.

For example, this stayed unsorted:

const Zebra = require("Zebra")
const Apple = require("Apple")

Summary

  • Adds Luau-only handling for Stmt::ConstAssignment in sort-requires
  • Reuses the same require-matching logic for local and const assignments
  • Preserves existing grouping, blank-line splitting, ignored-node behavior, and game:GetService sorting
  • Adds tests for const requires, mixed local/const blocks, type assertions, and services
  • Updates docs and changelog

ddashdev avatar May 23 '26 02:05 ddashdev

Plss

riptscripts avatar Jun 25 '26 01:06 riptscripts