style: remove all tslint related comments (#934)

This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 8278b63f0a
commit 5c1c104073
14 changed files with 3 additions and 34 deletions

View File

@@ -2,8 +2,7 @@
These are the style guidelines for coding in Electron. These are the style guidelines for coding in Electron.
You can run `yarn lint` to show any style issues detected by `tslint` and You can run `yarn lint` to show any style issues detected by `eslint`.
`eslint`.
## General Code ## General Code

View File

@@ -97,7 +97,6 @@ describe('integration tests', function (this: ISuite) {
it(title, async () => { it(title, async () => {
const page: puppeteer.Page = await browser.newPage(); const page: puppeteer.Page = await browser.newPage();
// console for debug // console for debug
// tslint:disable-next-line: no-console
page.on('console', (msg) => console.log(msg.text())); page.on('console', (msg) => console.log(msg.text()));
if (html.filePath === 'iframe.html') { if (html.filePath === 'iframe.html') {
// loading directly is needed to ensure we don't trigger compatMode='BackCompat' // 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 () => { it('correctly triggers backCompat mode and rendering', async () => {
const page: puppeteer.Page = await browser.newPage(); const page: puppeteer.Page = await browser.newPage();
// console for debug // console for debug
// tslint:disable-next-line: no-console
page.on('console', (msg) => console.log(msg.text())); page.on('console', (msg) => console.log(msg.text()));
await page.goto('http://localhost:3030/html/compat-mode.html', { 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 () => { it('snapshot async iframes', async () => {
const page: puppeteer.Page = await browser.newPage(); const page: puppeteer.Page = await browser.newPage();
// console for debug // console for debug
// tslint:disable-next-line: no-console
page.on('console', (msg) => console.log(msg.text())); page.on('console', (msg) => console.log(msg.text()));
await page.goto(`http://localhost:3030/iframe-html/main.html`, { await page.goto(`http://localhost:3030/iframe-html/main.html`, {
waitUntil: 'load', waitUntil: 'load',
@@ -293,7 +290,6 @@ describe('shadow DOM integration tests', function (this: ISuite) {
it('snapshot shadow DOM', async () => { it('snapshot shadow DOM', async () => {
const page: puppeteer.Page = await browser.newPage(); const page: puppeteer.Page = await browser.newPage();
// console for debug // console for debug
// tslint:disable-next-line: no-console
page.on('console', (msg) => console.log(msg.text())); page.on('console', (msg) => console.log(msg.text()));
await page.goto(`http://localhost:3030/html/shadow-dom.html`, { await page.goto(`http://localhost:3030/html/shadow-dom.html`, {
waitUntil: 'load', waitUntil: 'load',

View File

@@ -1,9 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */ /* 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 */
/* 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
/** /**
* Class StackFrame is a fork of https://github.com/stacktracejs/stackframe/blob/master/stackframe.js * Class StackFrame is a fork of https://github.com/stacktracejs/stackframe/blob/master/stackframe.js
* I fork it because: * I fork it because:

View File

@@ -1,4 +1,3 @@
// tslint:disable:no-any no-bitwise forin
/** /**
* this file is used to serialize log message to string * this file is used to serialize log message to string
* *
@@ -27,7 +26,6 @@ function pathToSelector(node: HTMLElement): string | '' {
const domSiblings = []; const domSiblings = [];
if (parent.children && parent.children.length > 0) { if (parent.children && parent.children.length > 0) {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < parent.children.length; i++) { for (let i = 0; i < parent.children.length; i++) {
const sibling = parent.children[i]; const sibling = parent.children[i];
if (sibling.localName && sibling.localName.toLowerCase) { if (sibling.localName && sibling.localName.toLowerCase) {

View File

@@ -720,8 +720,7 @@ function initFontObserver({ fontCb, doc }: observerParam): listenerHandler {
fontSource: fontSource:
typeof source === 'string' typeof source === 'string'
? source ? source
: // tslint:disable-next-line: no-any : JSON.stringify(Array.from(new Uint8Array(source))),
JSON.stringify(Array.from(new Uint8Array(source))),
}); });
return fontFace; return fontFace;
} as unknown) as typeof FontFace; } as unknown) as typeof FontFace;

View File

@@ -125,7 +125,6 @@ export class Replayer {
private nextUserInteractionEvent: eventWithTime | null; private nextUserInteractionEvent: eventWithTime | null;
// tslint:disable-next-line: variable-name
private legacy_missingNodeRetryMap: missingNodeMap = {}; private legacy_missingNodeRetryMap: missingNodeMap = {};
// The replayer uses the cache to speed up replay and scrubbing. // 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 * triggers the 'click' css animation in styles/style.css
*/ */
this.mouse.classList.remove('active'); this.mouse.classList.remove('active');
// tslint:disable-next-line
void this.mouse.offsetWidth; void this.mouse.offsetWidth;
this.mouse.classList.add('active'); this.mouse.classList.add('active');
} else if (d.type === MouseInteractions.TouchStart) { } else if (d.type === MouseInteractions.TouchStart) {
@@ -1401,7 +1399,6 @@ export class Replayer {
} }
}); });
// tslint:disable-next-line: variable-name
const legacy_missingNodeMap: missingNodeMap = { const legacy_missingNodeMap: missingNodeMap = {
...this.legacy_missingNodeRetryMap, ...this.legacy_missingNodeRetryMap,
}; };
@@ -1893,7 +1890,6 @@ export class Replayer {
if (!this.config.showDebug) { if (!this.config.showDebug) {
return; return;
} }
// tslint:disable-next-line: no-console
console.log(REPLAY_CONSOLE_PREFIX, ...args); console.log(REPLAY_CONSOLE_PREFIX, ...args);
} }
} }

View File

@@ -1,4 +1,3 @@
// tslint:disable-next-line: no-any
export type AnyObject = { [key: string]: any; __rrdom__?: RRdomTreeNode }; export type AnyObject = { [key: string]: any; __rrdom__?: RRdomTreeNode };
export class RRdomTreeNode implements AnyObject { export class RRdomTreeNode implements AnyObject {
@@ -30,7 +29,6 @@ export class RRdomTreeNode implements AnyObject {
} }
public childrenChanged() { public childrenChanged() {
// tslint:disable-next-line: no-bitwise
this.childrenVersion = (this.childrenVersion + 1) & 0xffffffff; this.childrenVersion = (this.childrenVersion + 1) & 0xffffffff;
this.childIndexCachedUpTo = null; this.childIndexCachedUpTo = null;
} }

View File

@@ -126,10 +126,8 @@ export function hookSetter<T>(
// copy from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts // copy from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts
export function patch( export function patch(
// tslint:disable-next-line:no-any
source: { [key: string]: any }, source: { [key: string]: any },
name: string, name: string,
// tslint:disable-next-line:no-any
replacement: (...args: unknown[]) => unknown, replacement: (...args: unknown[]) => unknown,
): () => void { ): () => void {
try { 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 // 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" // otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
// tslint:disable-next-line:strict-type-predicates
if (typeof wrapped === 'function') { if (typeof wrapped === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
wrapped.prototype = wrapped.prototype || {}; wrapped.prototype = wrapped.prototype || {};

View File

@@ -1,4 +1,3 @@
// tslint:disable:no-console no-any
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import type { Page } from 'puppeteer'; import type { Page } from 'puppeteer';

View File

@@ -1,4 +1,3 @@
// tslint:disable:no-console
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import type * as puppeteer from 'puppeteer'; import type * as puppeteer from 'puppeteer';

View File

@@ -1,5 +1,3 @@
/* tslint:disable no-console */
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import type * as puppeteer from 'puppeteer'; import type * as puppeteer from 'puppeteer';

View File

@@ -1,5 +1,3 @@
/* tslint:disable no-console */
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import type * as puppeteer from 'puppeteer'; import type * as puppeteer from 'puppeteer';

View File

@@ -1,5 +1,3 @@
/* tslint:disable no-string-literal no-console */
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import type * as puppeteer from 'puppeteer'; import type * as puppeteer from 'puppeteer';

View File

@@ -1,4 +1,3 @@
// tslint:disable:no-console no-any
import { NodeType } from 'rrweb-snapshot'; import { NodeType } from 'rrweb-snapshot';
import { import {
EventType, EventType,