diff --git a/docs/development/coding-style.md b/docs/development/coding-style.md index ef7556e3e1..d2f7598833 100644 --- a/docs/development/coding-style.md +++ b/docs/development/coding-style.md @@ -2,8 +2,7 @@ These are the style guidelines for coding in Electron. -You can run `yarn lint` to show any style issues detected by `tslint` and -`eslint`. +You can run `yarn lint` to show any style issues detected by `eslint`. ## General Code diff --git a/packages/rrweb-snapshot/test/integration.test.ts b/packages/rrweb-snapshot/test/integration.test.ts index e34432fd7b..cba669c152 100644 --- a/packages/rrweb-snapshot/test/integration.test.ts +++ b/packages/rrweb-snapshot/test/integration.test.ts @@ -97,7 +97,6 @@ describe('integration tests', function (this: ISuite) { it(title, async () => { const page: puppeteer.Page = await browser.newPage(); // console for debug - // tslint:disable-next-line: no-console page.on('console', (msg) => console.log(msg.text())); if (html.filePath === 'iframe.html') { // loading directly is needed to ensure we don't trigger compatMode='BackCompat' @@ -147,7 +146,6 @@ describe('integration tests', function (this: ISuite) { it('correctly triggers backCompat mode and rendering', async () => { const page: puppeteer.Page = await browser.newPage(); // console for debug - // tslint:disable-next-line: no-console page.on('console', (msg) => console.log(msg.text())); await page.goto('http://localhost:3030/html/compat-mode.html', { @@ -244,7 +242,6 @@ describe('iframe integration tests', function (this: ISuite) { it('snapshot async iframes', async () => { const page: puppeteer.Page = await browser.newPage(); // console for debug - // tslint:disable-next-line: no-console page.on('console', (msg) => console.log(msg.text())); await page.goto(`http://localhost:3030/iframe-html/main.html`, { waitUntil: 'load', @@ -293,7 +290,6 @@ describe('shadow DOM integration tests', function (this: ISuite) { it('snapshot shadow DOM', async () => { const page: puppeteer.Page = await browser.newPage(); // console for debug - // tslint:disable-next-line: no-console page.on('console', (msg) => console.log(msg.text())); await page.goto(`http://localhost:3030/html/shadow-dom.html`, { waitUntil: 'load', diff --git a/packages/rrweb/src/plugins/console/record/error-stack-parser.ts b/packages/rrweb/src/plugins/console/record/error-stack-parser.ts index 5f2497073a..4c0e49c309 100644 --- a/packages/rrweb/src/plugins/console/record/error-stack-parser.ts +++ b/packages/rrweb/src/plugins/console/record/error-stack-parser.ts @@ -1,9 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unsafe-argument */ -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-unsafe-return */ -// tslint:disable +/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return */ /** * Class StackFrame is a fork of https://github.com/stacktracejs/stackframe/blob/master/stackframe.js * I fork it because: diff --git a/packages/rrweb/src/plugins/console/record/stringify.ts b/packages/rrweb/src/plugins/console/record/stringify.ts index e15cf9d07c..97cc88688d 100644 --- a/packages/rrweb/src/plugins/console/record/stringify.ts +++ b/packages/rrweb/src/plugins/console/record/stringify.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-any no-bitwise forin /** * this file is used to serialize log message to string * @@ -27,7 +26,6 @@ function pathToSelector(node: HTMLElement): string | '' { const domSiblings = []; if (parent.children && parent.children.length > 0) { - // tslint:disable-next-line:prefer-for-of for (let i = 0; i < parent.children.length; i++) { const sibling = parent.children[i]; if (sibling.localName && sibling.localName.toLowerCase) { diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index 42afcfb602..f745a413b2 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -720,8 +720,7 @@ function initFontObserver({ fontCb, doc }: observerParam): listenerHandler { fontSource: typeof source === 'string' ? source - : // tslint:disable-next-line: no-any - JSON.stringify(Array.from(new Uint8Array(source))), + : JSON.stringify(Array.from(new Uint8Array(source))), }); return fontFace; } as unknown) as typeof FontFace; diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index 0c1598d24a..70efba2b9a 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -125,7 +125,6 @@ export class Replayer { private nextUserInteractionEvent: eventWithTime | null; - // tslint:disable-next-line: variable-name private legacy_missingNodeRetryMap: missingNodeMap = {}; // The replayer uses the cache to speed up replay and scrubbing. @@ -1050,7 +1049,6 @@ export class Replayer { * triggers the 'click' css animation in styles/style.css */ this.mouse.classList.remove('active'); - // tslint:disable-next-line void this.mouse.offsetWidth; this.mouse.classList.add('active'); } else if (d.type === MouseInteractions.TouchStart) { @@ -1401,7 +1399,6 @@ export class Replayer { } }); - // tslint:disable-next-line: variable-name const legacy_missingNodeMap: missingNodeMap = { ...this.legacy_missingNodeRetryMap, }; @@ -1893,7 +1890,6 @@ export class Replayer { if (!this.config.showDebug) { return; } - // tslint:disable-next-line: no-console console.log(REPLAY_CONSOLE_PREFIX, ...args); } } diff --git a/packages/rrweb/src/rrdom/tree-node.ts b/packages/rrweb/src/rrdom/tree-node.ts index 4759d50837..88839ee670 100644 --- a/packages/rrweb/src/rrdom/tree-node.ts +++ b/packages/rrweb/src/rrdom/tree-node.ts @@ -1,4 +1,3 @@ -// tslint:disable-next-line: no-any export type AnyObject = { [key: string]: any; __rrdom__?: RRdomTreeNode }; export class RRdomTreeNode implements AnyObject { @@ -30,7 +29,6 @@ export class RRdomTreeNode implements AnyObject { } public childrenChanged() { - // tslint:disable-next-line: no-bitwise this.childrenVersion = (this.childrenVersion + 1) & 0xffffffff; this.childIndexCachedUpTo = null; } diff --git a/packages/rrweb/src/utils.ts b/packages/rrweb/src/utils.ts index 028064ae80..2d0838b6f3 100644 --- a/packages/rrweb/src/utils.ts +++ b/packages/rrweb/src/utils.ts @@ -126,10 +126,8 @@ export function hookSetter( // copy from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts export function patch( - // tslint:disable-next-line:no-any source: { [key: string]: any }, name: string, - // tslint:disable-next-line:no-any replacement: (...args: unknown[]) => unknown, ): () => void { try { @@ -144,7 +142,6 @@ export function patch( // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" - // tslint:disable-next-line:strict-type-predicates if (typeof wrapped === 'function') { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment wrapped.prototype = wrapped.prototype || {}; diff --git a/packages/rrweb/test/benchmark/dom-mutation.test.ts b/packages/rrweb/test/benchmark/dom-mutation.test.ts index 8e446facca..26f03280de 100644 --- a/packages/rrweb/test/benchmark/dom-mutation.test.ts +++ b/packages/rrweb/test/benchmark/dom-mutation.test.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-console no-any import * as fs from 'fs'; import * as path from 'path'; import type { Page } from 'puppeteer'; diff --git a/packages/rrweb/test/integration.test.ts b/packages/rrweb/test/integration.test.ts index 8caa8cf35c..74c4fda1c2 100644 --- a/packages/rrweb/test/integration.test.ts +++ b/packages/rrweb/test/integration.test.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-console import * as fs from 'fs'; import * as path from 'path'; import type * as puppeteer from 'puppeteer'; diff --git a/packages/rrweb/test/record.test.ts b/packages/rrweb/test/record.test.ts index b45a6ce46c..7fd98d92f5 100644 --- a/packages/rrweb/test/record.test.ts +++ b/packages/rrweb/test/record.test.ts @@ -1,5 +1,3 @@ -/* tslint:disable no-console */ - import * as fs from 'fs'; import * as path from 'path'; import type * as puppeteer from 'puppeteer'; diff --git a/packages/rrweb/test/record/webgl.test.ts b/packages/rrweb/test/record/webgl.test.ts index 143dda2373..c51b6ddb78 100644 --- a/packages/rrweb/test/record/webgl.test.ts +++ b/packages/rrweb/test/record/webgl.test.ts @@ -1,5 +1,3 @@ -/* tslint:disable no-console */ - import * as fs from 'fs'; import * as path from 'path'; import type * as puppeteer from 'puppeteer'; diff --git a/packages/rrweb/test/replayer.test.ts b/packages/rrweb/test/replayer.test.ts index bf1a5fc2d3..4cfb3b0a31 100644 --- a/packages/rrweb/test/replayer.test.ts +++ b/packages/rrweb/test/replayer.test.ts @@ -1,5 +1,3 @@ -/* tslint:disable no-string-literal no-console */ - import * as fs from 'fs'; import * as path from 'path'; import type * as puppeteer from 'puppeteer'; diff --git a/packages/rrweb/test/utils.ts b/packages/rrweb/test/utils.ts index 89bc28453b..eb271598b9 100644 --- a/packages/rrweb/test/utils.ts +++ b/packages/rrweb/test/utils.ts @@ -1,4 +1,3 @@ -// tslint:disable:no-console no-any import { NodeType } from 'rrweb-snapshot'; import { EventType,