Slim-Lint – configurable linter for Slim templates

Slim-Lint is a command-line utility for finding style problems and common mistakes in Slim templates. It combines checks aimed specifically at Slim markup with RuboCop integration for analysing Ruby expressions embedded inside templates.

The tool can be used directly during development or incorporated into source-control, continuous integration and editor workflows. Its configuration system allows projects to choose which checks are appropriate and to restrict particular linters to selected files.

This is free and open source software.

Key Features

  • Recursively scans directories, accepts explicit file lists, or checks the current directory when no path is supplied.
  • Provides configurable checks for issues including line length, whitespace, tag case, redundant elements, empty lines and other Slim conventions.
  • Integrates with RuboCop to apply Ruby static analysis to code embedded inside Slim templates.
  • Offers automatic correction for supported offences where the required change can be made mechanically.
  • Uses a `.slim-lint.yml` file for configuring linters and defining file inclusion or exclusion rules.
  • Allows Slim-Lint checks and RuboCop cops to be disabled and re-enabled for selected sections of a template.
  • Can ignore frontmatter used by static-site generators when analysing templates.
  • Supports multiple reporters together with input supplied through standard input for integration with development tools.
  • Can be incorporated into editor integrations, Git hooks, GitHub Actions and Rake-based workflows.
  • Supports linter-specific include and exclude patterns, giving projects fine-grained control over where individual checks are applied.

Website: github.com/sds/slim-lint
Support:
Developer: Shane da Silva
License: MIT License

Slim-Lint is written in Ruby. Learn Ruby with our recommended free books and free tutorials.


Related Software

Ruby Linters
RuboCopRuby static code analyzer and formatter
ReekExamines Ruby classes, modules, and methods
Standard RubyProvides an opinionated, unconfigurable ruleset
HAML-LintRuby-based linter for HAML templates
Slim-LintConfigurable tool for analyzing Slim templates
ERB LintLint your ERB or HTML files
YARD-LintFor Ruby and Ruby on Rails projects that lint YARD documentation
oxicopFast Ruby linter

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted