naming-convention-constant
Enforce naming convention on constants
INFO
☑️ The predefined configuration "mslint:recommended" enables this rule.
Rule details
This rule enforces a few naming conventions for #Const directives:
- All constant names must be prefixed with
C_ - Libraries can add another prefix before the
C_prefix, for example:MyLibPrefix_C_ - One letter constant names are allowed. eg:
A,B,P,W, ...
The following special constants are exempt from these restrictions:
CompatibleMapTypesVersionScriptNameDescriptionCustomMusicFolder
Settings
exceptionsa list of constant names that are not checked by the rule. Default[].
Example of incorrect code for this rule:
maniascript
/*
{
"exceptions" = ["ConstIgnored"]
}
*/
#Const ConstA 1
#Const CC_ConstB 2
#Const C::ConstC as ConstC
#Const Lib_ConstD 4
#Const ConstNotIgnored 5Example of correct code for this rule:
maniascript
/*
{
"exceptions" = ["ConstIgnored"]
}
*/
#Const C_ConstA 1
#Const C_ConstB 2
#Const C::ConstC as C_ConstC
#Const Lib_C_ConstD 4
#Const ConstIgnored 5
#Const E 6
#Const CompatibleMapTypes "Race"
#Const Version "1.0.0"
#Const ScriptName "Path/To/Script/Name.Script.txt"
#Const Description "Description of the game mode"