0.0
The project is in a healthy, maintained state
A collection of ERB template linters designed for AI agent Ruby projects, enforcing consistent style and best practices including SVG tag restrictions, emoji usage controls, and class naming conventions
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0.3.0
 Project Readme

Erblint::Agent

Template style checking for Ruby projects aimed at AI agents.

Installation

Add this line to your application's Gemfile:

group :development do
  gem 'erb_lint', require: false
  gem 'erblint-agent', require: false
end

And then execute:

bundle install

Usage

Configuration

Require the lint rules from this library. Currently, the only supported way is to add a new file in .erb-linters/erblint_agent.rb with the line:

require 'erblint/agent/linters'

Create or update your .erb-lint.yml configuration file:

---
inherit_gem:
  erblint-agent:
    - config/default.yml
linters:
  Agent::NoDirectSvgTag:
    # message: "Custom error message" # Optional: customize the error message

  Agent::NoDirectEmoji:
    # message: "Custom error message" # Optional: customize the error message

  Agent::NoSpecificClasses:
    forbidden_classes:
      "card": "Use 'CardComponent' instead"

Running the Linters

Run erb-lint with:

bundle exec erb_lint --lint-all

Or check specific files:

bundle exec erb_lint app/views/**/*.erb

Available Linters

Agent::NoDirectSvgTag

Prohibits direct use of SVG tags. Recommends using Tailwind CSS Icons instead.

Configuration:

Agent::NoDirectSvgTag:
  enabled: true
  message: "Custom error message" # Optional: override default message

Bad:

<svg>...</svg>
<svg class="icon" />

Good:

<span class="i-bi-people"></span>

Agent::NoDirectEmoji

Prohibits direct use of Unicode emojis. Recommends using icon classes instead.

Configuration:

Agent::NoDirectEmoji:
  enabled: true
  message: "Custom error message" # Optional: override default message

Bad:

<p>Welcome! 😊</p>

Good:

<p>Welcome! <span class="i-bi-emoji-smile"></span></p>

Agent::NoSpecificClasses

Prohibits the use of specific class names defined in configuration.

Configuration:

Agent::NoSpecificClasses:
  enabled: true
  forbidden_classes:
    "btn-old": "Use 'btn' class instead"
    "text-bold": "Use 'font-bold' instead"

Bad:

<button class="btn-old">Click</button>
<p class="text-bold">Important</p>

Good:

<button class="btn">Click</button>
<p class="font-bold">Important</p>

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Erblint::Agent project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.