@@ -474,6 +474,7 @@ def sidecar_files(extensions)
474474 # view files in a directory named like the component
475475 directory = File . dirname ( source_location )
476476 filename = File . basename ( source_location , ".rb" )
477+ return [ ] if name . blank?
477478 component_name = name . demodulize . underscore
478479
479480 # Add support for nested components defined in the same file.
@@ -519,6 +520,11 @@ def inherited(child)
519520 # `compile` defines
520521 compile
521522
523+ # Set strict_helpers_enabled from global config
524+ if child . superclass == ViewComponent ::Base
525+ child . __vc_strict_helpers_enabled = Rails . application . config . view_component . strict_helpers_enabled
526+ end
527+
522528 # Give the child its own personal #render_template_for to protect against the case when
523529 # eager loading is disabled and the parent component is rendered before the child. In
524530 # such a scenario, the parent will override ViewComponent::Base#render_template_for,
@@ -629,6 +635,15 @@ def strip_trailing_whitespace?
629635 __vc_strip_trailing_whitespace
630636 end
631637
638+ # TODO
639+ def strict_helpers_enabled = ( value = true )
640+ self . __vc_strict_helpers_enabled = value
641+ end
642+
643+ def strict_helpers_enabled?
644+ __vc_strict_helpers_enabled
645+ end
646+
632647 # Ensure the component initializer accepts the
633648 # collection parameter. By default, we don't
634649 # validate that the default parameter name
0 commit comments