Sha256: 920348226d119602c9624254353b5119194bb7739fa9ae37c58139d59e75ef8b

Contents?: true

Size: 1.19 KB

Versions: 12

Compression:

Stored size: 1.19 KB

Contents

# Prevent missing theme-check-enable comments (`MissingEnableComment`)

When `theme-check-disable` is used in the middle of a theme file, the corresponding `theme-check-enable` comment should also be included.

## Check Details

This check aims at eliminating missing `theme-check-enable` comments.

:-1: Example of **incorrect** code for this check:

```liquid
<!doctype html>
<html>
  <head>
    {% comment %}theme-check-disable ParserBlockingJavaScript{% endcomment %}
    <script src="https://cdnjs.com/jquery.min.js"></script>
  </head>
  <body>
    <!-- ... -->
  </body>
</html>
```

:+1: Example of **correct** code for this check:

```liquid
<!doctype html>
<html>
  <head>
    {% comment %}theme-check-disable ParserBlockingJavaScript{% endcomment %}
    <script src="https://cdnjs.com/jquery.min.js"></script>
    {% comment %}theme-check-enable ParserBlockingJavaScript{% endcomment %}
  </head>
  <body>
    <!-- ... -->
  </body>
</html>
```

## Version

This check has been introduced in Theme Check 0.3.0.

## Resources

- [Rule Source][codesource]
- [Documentation Source][docsource]

[codesource]: /lib/theme_check/checks/missing_enable_comment.rb
[docsource]: /docs/checks/missing_enable_comment.md

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
theme-check-1.10.3 docs/checks/missing_enable_comment.md
theme-check-1.10.2 docs/checks/missing_enable_comment.md
theme-check-1.10.1 docs/checks/missing_enable_comment.md
theme-check-1.10.0 docs/checks/missing_enable_comment.md
theme-check-1.9.2 docs/checks/missing_enable_comment.md
theme-check-1.9.1 docs/checks/missing_enable_comment.md
theme-check-1.9.0 docs/checks/missing_enable_comment.md
theme-check-1.8.0 docs/checks/missing_enable_comment.md
theme-check-1.7.2 docs/checks/missing_enable_comment.md
theme-check-1.7.1 docs/checks/missing_enable_comment.md
theme-check-1.7.0 docs/checks/missing_enable_comment.md
theme-check-1.6.2 docs/checks/missing_enable_comment.md