preferModdingInspectReplace manual {{enumType}} enumeration with Modding.inspect<Record<{{enumType}}, true>>().Modding.inspectsmall-rules/prefer-modding-inspectPrefer Modding.inspect over manually enumerating every enum member in a Record<Enum, true>.
Writing Record<SomeEnum, true> by hand means listing every enum member as Member: true. Pointless busywork,
and you have to touch it every time the enum changes.
Modding.inspect<Record<SomeEnum, true>>() generates that map from the enum automatically whenever a new item is
added — so there’s just less to maintain. This catches the hand-written literal form and auto-fixes it.
preferModdingInspectReplace manual {{enumType}} enumeration with Modding.inspect<Record<{{enumType}}, true>>().This rule does not accept options.
const x: ReadonlyRecord<MyEnum, true> = { a: true, b: true };After auto-fix
const x = Modding.inspect<Record<MyEnum, true>>();const x = { a: true, b: true };