lib/react/element.rb
Literal typeof #{properties} === 'undefined'
appeared as a condition. Open
Open
@properties = (`typeof #{properties} === 'undefined'` ? nil : properties) || {}
- Read upRead up
- Exclude checks
This cop checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until.
Example:
# bad
if 20
do_something
end
Example:
# bad
if some_var && true
do_something
end
Example:
# good
if some_var && some_condition
do_something
end
Unused method argument - new_block
. If it's necessary, use _
or _new_block
as an argument name to indicate that it won't be used. Open
Open
def render(props = {}, &new_block)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end