Sha256: 690fa3cab2e12e35280468646ec25ab51e0f731b38caed92cb68b464b29fe219
Contents?: true
Size: 770 Bytes
Versions: 282
Compression:
Stored size: 770 Bytes
Contents
# frozen_string_literal: true require "rubocop" require "ariadne/view_components/statuses" require_relative "../../../../app/lib/ariadne/view_helper" module RuboCop module Cop module Ariadne # :nodoc: class BaseCop < RuboCop::Cop::Cop # We only verify SystemArguments if it's a `.new` call on a component or # a ViewHeleper call. def valid_node?(node) return if node.nil? view_helpers.include?(node.method_name) || (node.method_name == :new && !node.receiver.nil? && ::Ariadne::ViewComponents::STATUSES.key?(node.receiver.const_name)) end private def view_helpers ::Ariadne::ViewHelper::HELPERS.keys.map { |key| "ariadne_#{key}".to_sym } end end end end end
Version data entries
282 entries across 282 versions & 1 rubygems