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
'Prevent usage of `<img>` element due to slower LCP and higher bandwidth.',
category: 'HTML',
recommended: true,
url,
},
type: 'problem',
schema: [],
},
create(context) {
return {
JSXOpeningElement(node) {
if (node.name.name !== 'img') {
return
}
if (node.attributes.length === 0) {
return
}
if (node.parent?.parent?.openingElement?.name?.name === 'picture') {
return
}
context.report({
node,
message: `Using \`<img>\` could result in slower LCP and higher bandwidth. Use \`<Image />\` from \`next/image\` instead to utilize Image Optimization. See: ${url}`,