Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Comment thread
bsunderhus marked this conversation as resolved.
"type": "patch",
"comment": "chore: removes type dependency on @fluentui/react-utilities internals in ban-instanceof-html-element",
"packageName": "@fluentui/eslint-plugin",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: stops leaking HTMLElementConstructorName type",
"packageName": "@fluentui/react-utilities",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { AST_NODE_TYPES } = require('@typescript-eslint/utils');
const createRule = require('../../utils/createRule');

/**
* @typedef {import("@fluentui/react-utilities/src/utils/isHTMLElement").HTMLElementConstructorName} HTMLElementConstructorName
* @typedef {import('./types').HTMLElementConstructorName} HTMLElementConstructorName
*
*/

Expand Down Expand Up @@ -56,7 +56,6 @@ const constructorNames = [
'HTMLDataElement',
'HTMLDataListElement',
'HTMLDetailsElement',
// @ts-expect-error - NOTE: dialog is not supported in safari 14, also it was removed from lib-dom starting typescript 4.4
'HTMLDialogElement',
'HTMLDivElement',
'HTMLDListElement',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* All the possible HTML element constructor names.
*/
export type HTMLElementConstructorName =
| 'HTMLElement'
| 'HTMLAnchorElement'
| 'HTMLAreaElement'
| 'HTMLAudioElement'
| 'HTMLBaseElement'
| 'HTMLBodyElement'
| 'HTMLBRElement'
| 'HTMLButtonElement'
| 'HTMLCanvasElement'
| 'HTMLDataElement'
| 'HTMLDataListElement'
| 'HTMLDetailsElement'
| 'HTMLDialogElement'
| 'HTMLDivElement'
| 'HTMLDListElement'
| 'HTMLEmbedElement'
| 'HTMLFieldSetElement'
| 'HTMLFormElement'
| 'HTMLHeadingElement'
| 'HTMLHeadElement'
| 'HTMLHRElement'
| 'HTMLHtmlElement'
| 'HTMLIFrameElement'
| 'HTMLImageElement'
| 'HTMLInputElement'
| 'HTMLModElement'
| 'HTMLLabelElement'
| 'HTMLLegendElement'
| 'HTMLLIElement'
| 'HTMLLinkElement'
| 'HTMLMapElement'
| 'HTMLMetaElement'
| 'HTMLMeterElement'
| 'HTMLObjectElement'
| 'HTMLOListElement'
| 'HTMLOptGroupElement'
| 'HTMLOptionElement'
| 'HTMLOutputElement'
| 'HTMLParagraphElement'
| 'HTMLParamElement'
| 'HTMLPreElement'
| 'HTMLProgressElement'
| 'HTMLQuoteElement'
| 'HTMLSlotElement'
| 'HTMLScriptElement'
| 'HTMLSelectElement'
| 'HTMLSourceElement'
| 'HTMLSpanElement'
| 'HTMLStyleElement'
| 'HTMLTableElement'
| 'HTMLTableColElement'
| 'HTMLTableRowElement'
| 'HTMLTableSectionElement'
| 'HTMLTemplateElement'
| 'HTMLTextAreaElement'
| 'HTMLTimeElement'
| 'HTMLTitleElement'
| 'HTMLTrackElement'
| 'HTMLUListElement'
| 'HTMLVideoElement';
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export function isHTMLElement<ConstructorName extends HTMLElementConstructorName
);
}

/**
* @internal
*/
export type HTMLElementConstructorName =
type HTMLElementConstructorName =
| 'HTMLElement'
| 'HTMLAnchorElement'
| 'HTMLAreaElement'
Expand Down