rubocop-sorbet
rubocop-sorbet copied to clipboard
Cop suggestion: Sorbet/StructPropName for T::Struct properties
It would be great to have a cop that works like Naming/MethodName, but for T::Struct props
Personally I only plan to use snake_case for this right now, but for completeness the cop could support the same options as Naming/MethodName.
Naming/MethodName source: https://github.com/rubocop/rubocop/blob/master/lib/rubocop/cop/naming/method_name.rb
Example:
class Foo < T::Struct
const :fooConst, String # bad
const :foo_const, String # good
prop :fooProp, T::Boolean # bad
prop :foo_prop, T::Boolean # good
end