ViewComponent / view_component

A framework for building reusable, testable & encapsulated view components in Ruby on Rails.
https://viewcomponent.org
MIT License
3.17k stars 404 forks source link

Create a Strict Helpers mode #1976

Open reeganviljoen opened 4 months ago

reeganviljoen commented 4 months ago

Feature request

I have been thinking about extending https://github.com/ViewComponent/view_component/issues/1848 by adding a config that disables the use of helpers through helpers.<helper_name> and forces you to use use_helpers <helper_name> when you need helpers

A possible example could be:

config.view_component.use_strict_helpers = true

Motivation

This can help in developers that wish to make it easier to reason when using global state as is the intention with

https://github.com/ViewComponent/view_component/issues/1848