Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (37 loc) · 1.24 KB

undefined_object.md

File metadata and controls

58 lines (37 loc) · 1.24 KB

Prevent undefined object errors (UndefinedObject)

This check prevents errors by making sure that no undefined variables are being used

Check Details

This check is aimed at eliminating undefined object errors.

👎 Examples of incorrect code for this check:

{% assign greetings = "Hello" %}
{% if greeting == "Hello" %}

{{ articl }}
{{ prodcut }}

👍 Examples of correct code for this check:

{% assign greetings = "Hello" %}
{% if greetings == "Hello" %}

{{ article }}
{{ product }}

Check Options

The default configuration for this check is the following:

UndefinedObject:
  enabled: true
  exclude_snippets: true

exclude_snippets

The exclude_snippets (Default: true) option determines whether to check for undefined objects in snippets file (as objects may be defined as arguments)

When Not To Use It

It is discouraged to disable this rule.

Version

This check has been introduced in Theme Check 0.1.0.

Resources