You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related work done for and eslint rule linked below, but I think it only works with HTML within JavaScript, perhaps this could be built on, or used for inspiration: https://github.com/mizdra/eslint-plugin-layout-shift
The text was updated successfully, but these errors were encountered:
@louiechristie Hi Thanks for the suggestion. 👍
I agree about the idea of adding rules for improving CLS if possible.
But I'm not sure about the rule enforcing "width", "height "attributes can handle common cases well. it's because html-eslint does not support parsing CSS.
It has become important again to explicitly assign width and height attributes of img tags in html for preserving aspect ratio. For an explanation as to why, please read the two links I posted above.
Feature request - add rule that forbids media element without an explicit size attributes to prevent Layout Shift from occurring.
e.g. Enforce images to have a width and height property.
Because of calculating aspect ratios and improving Google page speed insights rankings:
https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/
Related work done for and eslint rule linked below, but I think it only works with HTML within JavaScript, perhaps this could be built on, or used for inspiration:
https://github.com/mizdra/eslint-plugin-layout-shift
The text was updated successfully, but these errors were encountered: