Skip to content

Ban Instances

ErrorRoblox
small-rules/ban-instances

Ban specified Roblox Instance classes and configured Instance properties.

Diagnostic Messages

bannedInstance
Instance class '{{className}}' is banned by project configuration. This class may cause performance issues, is deprecated, or has a better alternative. Check project guidelines for the recommended replacement.
bannedInstanceCustom
{{customMessage}}
bannedProperty
Property '{{propertyName}}' on Instance class '{{className}}' is banned by project configuration. This property may cause performance issues, is deprecated, or has a better alternative. Check project guidelines for the recommended replacement.
bannedPropertyCustom
{{customMessage}}

Configuration

This rule accepts one options object after the severity.

bannedInstancesOptional

Map of banned class names to custom messages, or an array of class names.

bannedPropertiesOptional

Map of banned class names to maps of banned property names and custom messages.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/ban-instances": [
"error",
{
"bannedInstances": [
"Part"
],
"bannedProperties": {
"UISizeConstraint": {
"MaxSize": "Use a different constraint shape."
}
}
}
]
}
}

Examples

banned instance construction
new Instance("Part");
unlisted instance class
new Instance("MeshPart");