Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
334 stars 96 forks source link

AssetPreload rule error on theme-check.yml #618

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi, I'm testing my theme with theme check, I'm using a default theme-check.yml file but when I run the command theme-check, i receive this error image

This is my default theme-check.yml file

root: 

extends: :nothing

require: []

include_categories: []

exclude_categories: []

ignore:
  - node_modules/*

ConvertIncludeToRender:
  enabled: true
  ignore: []

LiquidTag:
  enabled: true
  ignore: []
  min_consecutive_statements: 5

MissingTemplate:
  enabled: true
  ignore: []
  ignore_missing: []

NestedSnippet:
  enabled: true
  ignore: []
  max_nesting_level: 3

RequiredLayoutThemeObject:
  enabled: true
  ignore: []

SpaceInsideBraces:
  enabled: true
  ignore: []

SyntaxError:
  enabled: true
  ignore: []

TemplateLength:
  enabled: true
  ignore: []
  max_length: 600
  # Exclude content of {% schema %} in line count
  exclude_schema: true
  # Exclude content of {% stylesheet %} in line count
  exclude_stylesheet: true
  # Exclude content of {% javascript %} in line count
  exclude_javascript: true

UnknownFilter:
  enabled: true
  ignore: []

UnusedAssign:
  enabled: true
  ignore: []

UnusedSnippet:
  enabled: true
  ignore: []

MatchingSchemaTranslations:
  enabled: true
  ignore: []

MatchingTranslations:
  enabled: true
  ignore: []

DefaultLocale:
  enabled: true
  ignore: []

TranslationKeyExists:
  enabled: true
  ignore: []

ValidHTMLTranslation:
  enabled: true
  ignore: []

ValidJson:
  enabled: true
  ignore: []

ValidSchema:
  enabled: true
  ignore: []

MissingRequiredTemplateFiles:
  enabled: true
  ignore: []

UndefinedObject:
  enabled: true
  ignore: []
  exclude_snippets: true
  config_type: :default

RequiredDirectories:
  enabled: true
  ignore: []

DeprecatedFilter:
  enabled: true
  ignore: []

DeprecateLazysizes:
  enabled: true
  ignore: []

DeprecateBgsizes:
  enabled: true
  ignore: []

MissingEnableComment:
  enabled: true
  ignore: []

ParserBlockingJavaScript:
  enabled: true
  ignore: []

ParserBlockingScriptTag:
  enabled: true
  ignore: []

AssetPreload:
  enabled: true
  severity: suggestion

AssetSizeJavaScript:
  enabled: false
  threshold_in_bytes: 10_000
  ignore: []

AssetSizeCSS:
  enabled: false
  threshold_in_bytes: 100_000
  ignore: []

AssetSizeCSSStylesheetTag:
  enabled: false
  threshold_in_bytes: 100_000
  ignore: []

ImgWidthAndHeight:
  enabled: true
  ignore: []

RemoteAsset:
  enabled: true
  ignore: []

AssetUrlFilters:
  enabled: true
  ignore: []

ContentForHeaderModification:
  enabled: true
  ignore: []

ImgLazyLoading:
  enabled: true
  ignore: []

HtmlParsingError:
  enabled: true
  ignore: []

AssetSizeAppBlockJavaScript:
  enabled: false
  ignore: []
  threshold_in_bytes: 10_000

AssetSizeAppBlockCSS:
  enabled: false
  ignore: []
  threshold_in_bytes: 100_000

AppBlockValidTags:
  enabled: false
  ignore: []

PaginationSize:
  enabled: true
  ignore: []
  min_size: 1
  max_size: 50

DeprecatedGlobalAppBlockType:
  enabled: true

SchemaJsonFormat:
  enabled: true
  start_level: 0
  indent: '  '
charlespwd commented 2 years ago

Hey :wave: the AssetPreload check hasn't been released yet. Did you copy this config from the repo?

In the meantime, you can simply remove those lines from your .theme-check.yml file:

AssetPreload:
  enabled: true
  severity: suggestion
ghost commented 2 years ago

Yes @charlespwd I copy this config from the theme-check repo.

Thank's for your reply