Sha256: 5625ff04b1bb89719e373ff5bbb31ff5261aed7b006d12ff7d09fd41cbd21938

Contents?: true

Size: 350 Bytes

Versions: 23

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

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

23 entries across 23 versions & 1 rubygems

Version Path
slim_lint-0.31.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.31.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.30.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.29.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.28.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.27.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.26.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.25.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.24.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.23.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.22.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.22.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.21.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.21.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.20.2 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.20.1 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.20.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.19.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.18.0 lib/slim_lint/linter/empty_control_statement.rb
slim_lint-0.17.1 lib/slim_lint/linter/empty_control_statement.rb