You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixesrubocop#6858.
I think it was a mistake of multiple arguments.
## Before
```ruby
def to_json(_opts)
end
```
## After
```ruby
def to_json(*_args)
end
```
Expected behavior
With following suggestion at
Lint/ToJSON
, not raise error.https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/cop/lint/to_json.rb#L17
Actual behavior
Because I get
Lint/ToJSON
, I changed my code like belowThen,
Ex.new.to_json
start raising error sayingArgumentError: wrong number of arguments (given 0, expected 1)
As talked #6379 (comment), document should suggest the argument to be optional
RuboCop version
The text was updated successfully, but these errors were encountered: