The Godot Style Guide recommends PascalCase for preloaded classes:
Also use PascalCase when loading a class into a constant or a variable:
const Weapon = preload("res://weapon.gd")
But gdlint applies this restriction to preloaded assets too:
var visual_scene:= preload("res://scenes/bot_visual.tscn")
var visual: BotAnim = visual_scene.instantiate()
result:
Error: Function-scope preload variable name "visual_scene" is not valid (function-preload-variable-name)
I think gdlint should limit the name restriction to preloads that end with ".gd" or skip ones that end with ".tscn". More likely the former since preload is so general and the restriction is only for classes.
The Godot Style Guide recommends PascalCase for preloaded classes:
But gdlint applies this restriction to preloaded assets too:
I think gdlint should limit the name restriction to preloads that end with ".gd" or skip ones that end with ".tscn". More likely the former since preload is so general and the restriction is only for classes.