Skip to content

Commit

Permalink
Fix styling, remove exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewortwein committed Sep 24, 2024
1 parent 68d3baa commit b046610
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/rrweb-snapshot/src/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function buildStyleNode(
}

function buildNode(
n: serializedNodeWithId,
n: serializedNodeWithId & { chromaticAdoptedStylesheets?: string[] },
options: {
doc: Document;
hackCss: boolean;
Expand Down Expand Up @@ -380,13 +380,9 @@ function buildNode(
*/
if (!node.shadowRoot) {
node.attachShadow({ mode: 'open' });
// @ts-expect-error TODO
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
n.chromaticAdoptedStylesheets.forEach(
// @ts-expect-error TODO
n.chromaticAdoptedStylesheets?.forEach(
(chromaticAdoptedStylesheet) => {
const styleSheet = new CSSStyleSheet();
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
styleSheet.replaceSync(chromaticAdoptedStylesheet);
node.shadowRoot?.adoptedStyleSheets.push(styleSheet);
},
Expand Down

0 comments on commit b046610

Please sign in to comment.