[Link & Button] Refactor tag pattern for better typings #8264
Labels
0 - new
New issues that need assignment.
calcite-components
Issues specific to the @esri/calcite-components package.
estimate - 3
A day or two of work, likely requires updates to tests.
needs milestone
Planning workflow - pending milestone assignment, has priority and/or estimate.
p - low
Issue is non core or affecting less that 10% of people using the library
refactor
Issues tied to code that needs to be significantly reworked.
Description
Refactor the tag pattern for both the
link
andbutton
components:There are no current ESLink rules we can leverage, however we could explore a custom rule.
Proposed Advantages
Which Component
link
button
Relevant Info
Came up while discussing #8140
Addition research notes from @jcfranco:
Latest TypeScript shows the same thing. I think we don't get any warnings because of how the JSX type is constructed:
If you notice,
AnchorHTMLAttributes<HTMLAnchorElement> & HTMLAttributes<HTMLDivElement>
is an intersection and not a union, so it allows attr/props from either type. If you try any extraneous attr/prop, it will complain (as the above error shows).Calcite package
The text was updated successfully, but these errors were encountered: