Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
LINT: fix as many eslint warnings as possible
  • Loading branch information
YunFeng0817 committed Jul 7, 2022
commit 3cd43be9c42ba4057e80e1e68fbe1016f94e846d
5 changes: 4 additions & 1 deletion packages/rrdom-nodejs/src/document-nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ export class RRDocument
}

createDocument(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_namespace: string | null,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_qualifiedName: string | null,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_doctype?: DocumentType | null,
) {
return new RRDocument();
Expand Down Expand Up @@ -323,7 +326,7 @@ export class RRImageElement extends RRElement {
src: string;
width: number;
height: number;
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onload: ((this: GlobalEventHandlers, ev: Event) => unknown) | null;
}

export class RRMediaElement extends BaseRRMediaElementImpl(RRElement) {}
Expand Down
5 changes: 1 addition & 4 deletions packages/rrdom/src/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,7 @@ export function createOrGetNode(
let tagName = (rrNode as IRRElement).tagName.toLowerCase();
tagName = SVGTagMap[tagName] || tagName;
if (sn && 'isSVG' in sn && sn?.isSVG) {
node = document.createElementNS(
NAMESPACES['svg'],
(rrNode as IRRElement).tagName.toLowerCase(),
);
node = document.createElementNS(NAMESPACES['svg'], tagName);
} else node = document.createElement((rrNode as IRRElement).tagName);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/rrdom/src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export interface IRRCDATASection extends IRRNode {
}

type ConstrainedConstructor<T = Record<string, unknown>> = new (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
) => T;

Expand All @@ -138,7 +139,7 @@ export class BaseRRNode implements IRRNode {
public readonly nodeName: string;
public readonly RRNodeType: RRNodeType;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
constructor(..._args: any[]) {
//
}
Expand Down
3 changes: 1 addition & 2 deletions packages/rrweb-snapshot/src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* 1. The css library was built for node.js which does not have tree-shaking supports.
* 2. Rewrites into typescript give us a better type interface.
*/

/* tslint:disable no-conditional-assignment interface-name no-shadowed-variable */
/* eslint-disable tsdoc/syntax */

export interface ParserOptions {
/** Silently fail on parse errors */
Expand Down
4 changes: 2 additions & 2 deletions packages/rrweb/src/replay/canvas/2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default async function canvasMutation({

if (mutation.setter) {
// skip some read-only type checks
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(ctx as any)[mutation.property] = mutation.args[0];
((ctx as unknown) as Record<string, unknown>)[mutation.property] =
mutation.args[0];
return;
}
const original = ctx[
Expand Down
1 change: 0 additions & 1 deletion packages/rrweb/src/replay/timer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class Timer {
}
/**
* Add an action after the timer starts.
* @param action
*/
public addAction(action: actionWithDelay) {
const index = this.findActionIndex(action);
Expand Down