-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
I'm upgrading from version 2 to 4 for a large codebase and noticed that the method chaining behavior seems to have changed:
# Before
sig do
params(foo: String)
.returns(Integer)
end
# After
sig do
params(foo: String).returns(Integer)
end
# Before
Fixture
.of(Foo)
.create!(bar: 1)
# After
Fixture.of(Foo).create!(
bar: 1
)
# Before
foo = Foo
.where(foo: bar)
.where(baz: 4)
# After
foo =
Foo.where(
foo: bar
).where(baz: 4)
Which seems intended looking at the tests[0], where it also seems to be a bit inconsistent between tests—e.g., within sig blocks
doesn't chain while chains with other methods
does. Is there a way to force the old behavior of always chaining? Maybe with a syntax-tree plugin?
[0] https://github.com/prettier/plugin-ruby/blob/main/test/js/ruby/nodes/calls.test.js#L63-L68
Metadata
Metadata
Assignees
Labels
No labels