Skip to content

Commit

Permalink
fix: fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos committed Oct 19, 2023
1 parent 1748485 commit 5a02c83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions packages/sandbox/src/patchers/dynamicAppend/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ export function isHijackingTag(tagName?: string) {
* @param element
*/
export function isStyledComponentsLike(element: HTMLStyleElement) {
return (
!element.textContent &&
((element.sheet as CSSStyleSheet)?.cssRules.length || getStyledElementCSSRules(element)?.length)
);
return !element.textContent && (element.sheet?.cssRules.length || getStyledElementCSSRules(element)?.length);
}

const appsCounterMap = new Map<string, { bootstrappingPatchCount: number; mountingPatchCount: number }>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare global {
}

interface Window {
__sandboxConfigWeakMap__: WeakMap<Sandbox, SandboxConfig>;
__currentLockingSandbox__: Sandbox;
__sandboxConfigWeakMap__?: WeakMap<Sandbox, SandboxConfig>;
__currentLockingSandbox__?: Sandbox;
}

interface Document {
Expand Down Expand Up @@ -260,7 +260,7 @@ export function patchStandardSandbox(
if (typeof refNo === 'number' && refNo !== -1) {
// the reference node may be dynamic script comment which is not rebuilt while remounting thus reference node no longer exists
// in this case, we should append the style element to the end of mountDom
const refNode = mountDom.childNodes[refNo] || null;
const refNode = mountDom.childNodes[refNo];
rawHeadInsertBefore.call(mountDom, stylesheetElement, refNode);
return true;
}
Expand Down

0 comments on commit 5a02c83

Please sign in to comment.