Link Search Menu Expand Document (external link)

Description

This rule enforces a consistent naming convention for score holder names (fake names).

JSON Format

  • (string) A regex specifying the pattern of the name. The name will be considered valid if any part of it matches the regex, so use ^ and $ if you want the full name to be tested.

Example 1. Snake case
Config
{
	"lint": {
		"nameOfScoreHolder": "^[a-z]+(_[a-z]+)*$"
	}
}
👍 Good
execute if score foo objective matches 1 run say hello world!
execute if score foo_bar objective matches 1 run say hello world!
👎 Bad
execute if score FooBar objective matches 1 run say hello world!

Severity

All diagnostics provided by this linter will be of warning severity by default. You can wrap the config value in a tuple like this to change the severity to one of error, warning, information, or hint:

Config
{
	"lint": {
		"nameOfScoreHolder": ["error", <value>]
	}
}

To Disable

If you do not wish to utilize this rule, simply set it to null:

Config
{
	"lint": {
		"nameOfScoreHolder": null
	}
}