globalThis`globalThis` is not supported in roblox-ts.small-rules/no-unsupported-syntaxDisallow syntax that roblox-ts cannot compile to Luau.
This is a port from the official
roblox-ts ESLint plugin. It bans you
from writing TypeScript that roblox-ts cannot turn into Luau, like globalThis, labeled
statements, .prototype, regex literals, and (sometimes) rest elements in destructuring
patterns all get flagged on by default.
Every check is individually configurable, though, because not every Roblox-side compiler shares the same
limits. The one that matters to me is spreadDestructuring: sloptor supports it, so running
this rule with the default settings against sloptor code is wrong.
This is valid with sloptor!
const array = [1, 2, 3, 4, 5];const [a, , ...rest] = array;-- Compiled with sloptor v2.3.3local array = { 1, 2, 3, 4, 5 }local a = array[1]local rest = table.move(array, 3, #array, 1, {})return nilEven the hole in the middle survives, the rest is table.move’d to a fresh table, starting after the skipped
element. If you’re on sloptor, turn that check off:
{ "rules": { "small-rules/no-unsupported-syntax": ["error", { "spreadDestructuring": false }] }}The other four stay on. If your compiler ever grows support for one of them (somehow), toggle need to disable the whole rule.
globalThis`globalThis` is not supported in roblox-ts.label`label` is not supported in roblox-ts.prototype`.prototype` is not supported in roblox-ts.regexLiteralRegex literals are not supported in roblox-ts.spreadDestructuringOperator `...` is not supported for destructuring!This rule accepts one options object after the severity.
const { a, ...rest } = obj;const { a, b } = obj;