Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: remove all tslint related comments #934

Merged
merged 1 commit into from
Jul 22, 2022
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
3 changes: 1 addition & 2 deletions docs/development/coding-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions packages/rrweb-snapshot/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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', {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 0 additions & 2 deletions packages/rrweb/src/plugins/console/record/stringify.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// tslint:disable:no-any no-bitwise forin
/**
* this file is used to serialize log message to string
*
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -1401,7 +1399,6 @@ export class Replayer {
}
});

// tslint:disable-next-line: variable-name
const legacy_missingNodeMap: missingNodeMap = {
...this.legacy_missingNodeRetryMap,
};
Expand Down Expand Up @@ -1893,7 +1890,6 @@ export class Replayer {
if (!this.config.showDebug) {
return;
}
// tslint:disable-next-line: no-console
console.log(REPLAY_CONSOLE_PREFIX, ...args);
}
}
2 changes: 0 additions & 2 deletions packages/rrweb/src/rrdom/tree-node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// tslint:disable-next-line: no-any
export type AnyObject = { [key: string]: any; __rrdom__?: RRdomTreeNode };

export class RRdomTreeNode implements AnyObject {
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 0 additions & 3 deletions packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ export function hookSetter<T>(

// 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 {
Expand All @@ -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 || {};
Expand Down
1 change: 0 additions & 1 deletion packages/rrweb/test/benchmark/dom-mutation.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion packages/rrweb/test/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// tslint:disable:no-console
import * as fs from 'fs';
import * as path from 'path';
import type * as puppeteer from 'puppeteer';
Expand Down
2 changes: 0 additions & 2 deletions packages/rrweb/test/record.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* tslint:disable no-console */

import * as fs from 'fs';
import * as path from 'path';
import type * as puppeteer from 'puppeteer';
Expand Down
2 changes: 0 additions & 2 deletions packages/rrweb/test/record/webgl.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* tslint:disable no-console */

import * as fs from 'fs';
import * as path from 'path';
import type * as puppeteer from 'puppeteer';
Expand Down
2 changes: 0 additions & 2 deletions packages/rrweb/test/replayer.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion packages/rrweb/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// tslint:disable:no-console no-any
import { NodeType } from 'rrweb-snapshot';
import {
EventType,
Expand Down