Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react/no-unknown-property stopped supporting imageSrcSet and imagSizes on <link /> tag #3401

Closed
terrymun opened this issue Sep 5, 2022 · 1 comment

Comments

@terrymun
Copy link
Contributor

terrymun commented Sep 5, 2022

Version 7.31.6 will cause a linting error to be thrown when imageSrcSet or imageSizes are being used in a JSX <link /> element, even though this attribute is perfectly valid: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-imagesrcset

Combing through the rules reveal that these attributes are missing: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/no-unknown-property.js

It is also available in the LinkHTMLAttributes type:

interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
  as?: string | undefined;
  crossOrigin?: string | undefined;
  href?: string | undefined;
  hrefLang?: string | undefined;
  integrity?: string | undefined;
  media?: string | undefined;
  imageSrcSet?: string | undefined;
  imageSizes?: string | undefined;
  referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
  rel?: string | undefined;
  sizes?: string | undefined;
  type?: string | undefined;
  charSet?: string | undefined;
}
@terrymun terrymun changed the title react/no-unknown-property stopped supporting 'imageSrcSet' on <link /> tag react/no-unknown-property stopped supporting 'imageSrcSet' and imagSizes on <link /> tag Sep 5, 2022
@terrymun terrymun changed the title react/no-unknown-property stopped supporting 'imageSrcSet' and imagSizes on <link /> tag react/no-unknown-property stopped supporting imageSrcSet and imagSizes on <link /> tag Sep 5, 2022
@terrymun
Copy link
Contributor Author

terrymun commented Sep 5, 2022

PR has been created here: #3407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant