This is a fork of prettier plugin-ruby, which is used in Awesome Code
npm install prettier awesomecode-plugin-ruby
npx prettier *.rb
It removes the following configurations
rubyArrayLiteral
rubyHashLabel
rubyModifier
rubyToProc
It contains the following changes
longarrayname[index]
won't be transformed to
longarrayname[index]
/abc/
won't be transformed to
%r{abc}
array.each { |element| element.to_s }
won't be transformed to
array.each(&:to_s)
['foo']
[:bar]
won't be transformed to
%w[foo]
%i[bar]
e.g.
if result
'foo'
else
'bar'
end
won't be transformed to
result ? 'foo' : 'bar'
e.g.
while true
break :value
end
won't be transformed to
break :value while true
e.g.
included do
has_many :build_items, dependent: :destroy
end
won't be transformed to
included { has_many :build_items, dependent: :destroy }