# Linter Rule: Require the `framework` option **Rule:** `herb-config-framework-option` ## Description Reports templates in a project that doesn't set `framework` in its `.herb.yml`. The rule stays quiet as soon as `framework` is set, whichever value it is set to. When a template shows what it is rendered by, the offense says so and suggests that value. Otherwise it lists the values to choose from. ## Rationale Herb tailors itself to the `framework` option. It decides what Herb may assume about a template, which rules apply, and which optimizations it can take. Without it Herb falls back to `ruby` and treats every template as plain ERB, which is the most conservative behavior it has. The option is a project-level setting, and the CLI warns about it once per run, but that warning never reaches an editor. This rule brings it to where templates are actually written. Two signals tell Herb the project is likely Action View, and both only shape the message: - a strict locals declaration, which only Action View reads - a call to a helper whose name is unmistakably Action View, so `link_to` and `image_tag` count while `render`, `params`, and `t` don't Neither is a requirement for the offense. A template with no Ruby in it at all still reports, because the option is still missing. The rule reports once per file, on the first line, and a CLI run collapses those down to a single offense since one missing config key doesn't need one report per template. ## Examples ### ✅ Good Any value silences the rule, including the `ruby` default when that is what the project means: ```yaml [.herb.yml] framework: actionview ``` ```yaml [.herb.yml] framework: ruby ``` ### 🚫 Bad Without the option, every template reports: ```erb