Sha256: 43bf8808b05f006a57fc1b1dc365c71df7b15efb251f8f89b135cadcb626a19c

Contents?: true

Size: 414 Bytes

Versions: 6

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

module SlimLint
  # Reports on missing strict locals magic line in Slim templates.
  class Linter::StrictLocalsMissing < Linter
    include LinterRegistry

    on_start do |_sexp|
      unless document.source =~ %r{/#\s+locals:\s+\(.*\)}
        dummy_node = Struct.new(:line)
        report_lint(dummy_node.new(1), 'Strict locals magic line is missing')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slim_lint-0.31.1 lib/slim_lint/linter/strict_locals_missing.rb
slim_lint-0.31.0 lib/slim_lint/linter/strict_locals_missing.rb
slim_lint-0.30.0 lib/slim_lint/linter/strict_locals_missing.rb
slim_lint-0.29.0 lib/slim_lint/linter/strict_locals_missing.rb
slim_lint-0.28.0 lib/slim_lint/linter/strict_locals_missing.rb
slim_lint-0.27.0 lib/slim_lint/linter/strict_locals_missing.rb