StyLua
StyLua copied to clipboard
Fix sort_requires not recognizing `const` imports in luau
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::ConstAssignmentin sort-requires - Reuses the same require-matching logic for
localandconstassignments - Preserves existing grouping, blank-line splitting, ignored-node behavior, and
game:GetServicesorting - Adds tests for
constrequires, mixedlocal/constblocks, type assertions, and services - Updates docs and changelog
Plss