-
-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
As a Roblox Developer, I'd like to request a new linter rule that warns when developers try to directly access services (eg: game.Players) instead of using the preferred way which is using game:GetService("Players").
Disallow direct property access:
local Players = game.Players
local ReplicatedStorage = game.ReplicatedStorageRequire GetService() to access services
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")Rationale:
game:GetService()matches Roblox's recommended coding practices- Allows developers to have consistent looking code
- It is safer to use
game:GetService()as sometimes directly accessing services may not exist yet
Potential Implementation:
- A linter rule named
roblox_incorrect_service_get - Detect code that uses
game.<ServiceName>when<ServiceName>is a real Roblox service
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels