Browse Source

fix warnings

Gergely Gombos 1 year ago
parent
commit
d8eb56811e

+ 1 - 1
lib/docs/filters/react/clean_html_react_dev.rb

@@ -6,7 +6,7 @@ module Docs
 
         # Remove breadcrumbs before h1
         css('h1').each do |node|
-          if (node.previous)
+          if node.previous
             node.previous.remove
           end
         end

+ 8 - 4
lib/docs/filters/react/entries_react_dev.rb

@@ -3,7 +3,8 @@ module Docs
     class EntriesReactDevFilter < Docs::EntriesFilter
       def get_name
         name = at_css('article h1')&.content
-        return update_canary_copy(name)
+
+        update_canary_copy(name)
       end
 
       def get_type
@@ -17,12 +18,14 @@ module Docs
                          &.concat(": ")
         is_learn_page = path.start_with?('learn/') || slug == 'learn'
         prefix = is_learn_page ? 'Learn: ' : top_category || ''
-        return update_canary_copy(prefix + (category || 'Miscellaneous'))
+
+        update_canary_copy(prefix + (category || 'Miscellaneous'))
       end
 
       def update_canary_copy(string)
         canary_copy = '- This feature is available in the latest Canary'
-        return string.sub(canary_copy, ' (Canary)')
+
+        string.sub(canary_copy, ' (Canary)')
       end
 
       def additional_entries
@@ -34,7 +37,8 @@ module Docs
           next if excluded.include?(name.downcase)
           entries << [name, node['id'], type]
         end
-        return entries
+
+        entries
       end
     end
   end