Stencil version:
I looked at the code in GitHub and it doesn't appear to be in the latest version (2.6.0).
I'm submitting a:
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
The referrerPolicy attribute doesn't exist in JSX types, causing a failed build when using this attribute unless I use // @ts-expect-error to suppress the error.
Expected behavior:
The attribute referrerPolicy should exist for JSXBase.AnchorHTMLAttributes and be a string, causing there to be no TypeScript error when building the application.
Steps to reproduce:
- Use the attribute
referrerPolicy on an <a> tag and observe the compile failure.
Related code:
// Type '{ href: string; target: string; referrerPolicy: string; }' is not
// assignable to type 'AnchorHTMLAttributes<HTMLAnchorElement>'.
//
// Property 'referrerPolicy' does not exist on type
// 'AnchorHTMLAttributes<HTMLAnchorElement>'.ts(2322)
<a referrerPolicy="no-referrer-when-downgrade" />
Other information:
Alternately, the type of referrerPolicy could be an enumeration, as in @types/react https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L1993-L2014
This is a greater maintenance burden if more referrer policies are added in the future, but it should lead to a better developer experience in most cases, especially considering that the strings are quite long (e.g. "strict-origin-when-cross-origin"), and easy to misspell (e.g. "no-referer" instead of "no-referrer").
I can create a pull request for this, but I would like guidance on whether I should go with string or the previously mentioned enumeration from @types/react before creating it.
Stencil version:
I looked at the code in GitHub and it doesn't appear to be in the latest version (2.6.0).
I'm submitting a:
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
The
referrerPolicyattribute doesn't exist in JSX types, causing a failed build when using this attribute unless I use// @ts-expect-errorto suppress the error.Expected behavior:
The attribute
referrerPolicyshould exist forJSXBase.AnchorHTMLAttributesand be a string, causing there to be no TypeScript error when building the application.Steps to reproduce:
referrerPolicyon an<a>tag and observe the compile failure.Related code:
Other information:
Alternately, the type of
referrerPolicycould be an enumeration, as in@types/reacthttps://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L1993-L2014This is a greater maintenance burden if more referrer policies are added in the future, but it should lead to a better developer experience in most cases, especially considering that the strings are quite long (e.g. "strict-origin-when-cross-origin"), and easy to misspell (e.g. "no-referer" instead of "no-referrer").
I can create a pull request for this, but I would like guidance on whether I should go with
stringor the previously mentioned enumeration from@types/reactbefore creating it.