Sha256: 6b141d9a15d7fb5cdb12b43903bcdbd9b70ce5ae5bf3435733d8332791b8c839

Contents?: true

Size: 319 Bytes

Versions: 20

Compression:

Stored size: 319 Bytes

Contents

module SlimLint
  # Searches for control statements with no code.
  class Linter::EmptyControlStatement < Linter
    include LinterRegistry

    on [:slim, :control] do |sexp|
      _, _, code = sexp
      next unless code[/\A\s*\Z/]

      report_lint(sexp, 'Empty control statement can be removed')
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
slim_lint-0.15.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.15.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.14.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.13.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.12.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.11.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.10.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.9.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.8.3 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.8.2 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.8.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.8.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.7.2 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.7.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.7.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.6.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.6.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.5.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.4.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.3.0 lib/slim_lint/linter/empty_control_statement.rb