README.md in theme-check-0.2.2 vs README.md in theme-check-0.3.0

- old
+ new

@@ -2,11 +2,11 @@ Think RuboCop, or eslint, but for Shopify themes. Theme Check is a command line tool that helps you follow Shopify Themes & Liquid best practices by analyzing the Liquid & JSON inside your theme. -Code editor support coming soon! +Theme Check is also available [inside some code editors](https://github.com/Shopify/theme-check/wiki). ![](docs/preview.png) _Disclaimer: This tool is not supported as part of the Partners program._ @@ -28,12 +28,13 @@ ✅ Missing or extra spaces inside `{% ... %}` and `{{ ... }}` ✅ Missing default locale file ✅ Unmatching translation keys in locale files ✅ Using unknown translation keys in `{{ 'missing_key' | t }}` ✅ Using several `{% ... %}` instead of `{% liquid ... %}` -✅ Undefined [objects](https://shopify.dev/docs/themes/liquid/reference/objects) +✅ Undefined [objects](https://shopify.dev/docs/themes/liquid/reference/objects) ✅ Deprecated filters +✅ Missing `theme-check-enable` comment And many more to come! Suggestions welcome ([create an issue](https://github.com/Shopify/theme-check/issues)). ## Requirements @@ -77,13 +78,55 @@ # If your theme is not using the supported directory structure, provide the root path # where to find the `templates/`, `sections/`, `snippets/` directories as they would # be uploaded to Shopify. root: dist +# It is possible to extend theme-check with custom checks +require: + - ./path/to/my_custom_check.rb + # Disable some checks TemplateLength: enabled: false # Or configure options max_length: 300 + +# Enable a custom check +MyCustomCheck + enabled: true ``` See [config/default.yml](config/default.yml) for available options & defaults. + +## Disable checks with comments + +Use Liquid comments to disable and re-enable all checks for a section of your template: + +```liquid +{% comment %}theme-check-disable{% endcomment %} +{% assign x = 1 %} +{% comment %}theme-check-enable{% endcomment %} +``` + +Disable a specific check by including it in the comment: + +```liquid +{% comment %}theme-check-disable UnusedAssign{% endcomment %} +{% assign x = 1 %} +{% comment %}theme-check-enable UnusedAssign{% endcomment %} +``` + +Disable multiple checks by including them as a comma-separated list: + +```liquid +{% comment %}theme-check-disable UnusedAssign,SpaceInsideBraces{% endcomment %} +{%assign x = 1%} +{% comment %}theme-check-enable UnusedAssign,SpaceInsideBraces{% endcomment %} +``` + +Disable checks for the _entire document_ by placing the comment on the first line: + +```liquid +{% comment %}theme-check-disable SpaceInsideBraces{% endcomment %} + +{%assign x = 1%} +```