noAsyncInSystemDo not call a yielding Roblox API from a synchronous Planck system.small-rules/no-async-in-systemDisallow yielding Roblox API calls in synchronous Planck system execution.
noAsyncInSystemDo not call a yielding Roblox API from a synchronous Planck system.This rule accepts one options object after the severity.
import { Players as RobloxPlayers } from "@rbxts/services"; const socialSystem: SystemFunction = () => RobloxPlayers.GetFriendsAsync(userId);import { Players } from "@rbxts/services"; const system: SystemFunction = () => { world.added(PlayerComponent, () => Players.GetFriendsAsync(userId)); };Planck systems run synchronously. A yielding Roblox API call can pause a system midway through a world update, so this rule reports those calls from the active system function.
The rule recognizes functions typed as PlanckSystem, System,
SystemFunction,SystemReturn, or SystemTableLike. It also checks
functions returned by system factories and the system property of objects typed with, or
satisfying, one of those system types.
Yielding members come from the Roblox API catalog bundled with the plugin. The rule resolves services
imported from
@rbxts/services, services returned by game.GetService(), and Roblox class names
supplied by type annotations.
Use additionalSystemTypeNames for project-specific Planck wrappers.
synchronousCallbacks
identifies callback arguments that run before the surrounding call returns.
callbackParameterTypes
describes callback parameter types supplied by imported APIs when TypeScript syntax does not include them.