Sha256: b7403de135f28790530a8519164e23b5749334fd105b1a7e812f7f80a1c0b65d

Contents?: true

Size: 1.3 KB

Versions: 24

Compression:

Stored size: 1.3 KB

Contents

# Deprecate lazySizes (`DeprecateLazysizes`)

[lazysizes](https://github.com/aFarkas/lazysizes) is a common JavaScript library used to lazy load images, iframes and scripts.

## Check Details

This check is aimed at discouraging the use of the lazysizes JavaScript library

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

```liquid

<!-- Reports use of "data-srcset" and "data-sizes" attribute. Reports data-sizes="auto" -->
<img
  alt="House by the lake"
  data-sizes="auto"
  data-srcset="small.jpg 500w,
  medium.jpg 640w,
  big.jpg 1024w"
  data-src="medium.jpg"
  class="lazyload"
/>

```

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

```liquid

<!-- Does not use lazySizes library. Instead uses native "loading" attribute -->
<img src="a.jpg" loading="lazy">

```

## Check Options

The default configuration for this check is the following:

```yaml
DeprecateLazysizes:
  enabled: true
```

## When Not To Use It

You should disable this rule if you want to support lazy loading of images in older browser that don't support the loading="lazy" attribute yet.

## Version

This check has been introduced in Theme Check 1.0.0.

## Resources

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

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
theme-check-1.15.0 docs/checks/deprecate_lazysizes.md
theme-check-1.14.0 docs/checks/deprecate_lazysizes.md
theme-check-1.13.0 docs/checks/deprecate_lazysizes.md
theme-check-1.12.1 docs/checks/deprecate_lazysizes.md
theme-check-1.12.0 docs/checks/deprecate_lazysizes.md
theme-check-1.11.0 docs/checks/deprecate_lazysizes.md
theme-check-1.10.3 docs/checks/deprecate_lazysizes.md
theme-check-1.10.2 docs/checks/deprecate_lazysizes.md
theme-check-1.10.1 docs/checks/deprecate_lazysizes.md
theme-check-1.10.0 docs/checks/deprecate_lazysizes.md
theme-check-1.9.2 docs/checks/deprecate_lazysizes.md
theme-check-1.9.1 docs/checks/deprecate_lazysizes.md
theme-check-1.9.0 docs/checks/deprecate_lazysizes.md
theme-check-1.8.0 docs/checks/deprecate_lazysizes.md
theme-check-1.7.2 docs/checks/deprecate_lazysizes.md
theme-check-1.7.1 docs/checks/deprecate_lazysizes.md
theme-check-1.7.0 docs/checks/deprecate_lazysizes.md
theme-check-1.6.2 docs/checks/deprecate_lazysizes.md
theme-check-1.6.1 docs/checks/deprecate_lazysizes.md
theme-check-1.6.0 docs/checks/deprecate_lazysizes.md