chore: update eslintignore to lint files in utils/ folders

This commit is contained in:
Max Schmitt 2024-10-22 11:37:52 +02:00
parent 2a3d67195d
commit bd7ba9e200
7 changed files with 23 additions and 25 deletions

View file

@ -8,14 +8,11 @@ test/assets/modernizr.js
/packages/playwright-ct-core/src/generated/* /packages/playwright-ct-core/src/generated/*
/index.d.ts /index.d.ts
node_modules/ node_modules/
browser_patches/*/checkout/
browser_patches/chromium/output/
**/*.d.ts **/*.d.ts
output/ output/
test-results/ test-results/
tests/components/ /tests/components/
tests/installation/fixture-scripts/ /tests/installation/fixture-scripts/
examples/
DEPS DEPS
.cache/ .cache/
utils/ /utils/

View file

@ -33,11 +33,12 @@ function encodeBase128(value: number): Buffer {
do { do {
let byte = value & 0x7f; let byte = value & 0x7f;
value >>>= 7; value >>>= 7;
if (bytes.length > 0) byte |= 0x80; if (bytes.length > 0)
byte |= 0x80;
bytes.push(byte); bytes.push(byte);
} while (value > 0); } while (value > 0);
return Buffer.from(bytes.reverse()); return Buffer.from(bytes.reverse());
}; }
// ASN1/DER Speficiation: https://www.itu.int/rec/T-REC-X.680-X.693-202102-I/en // ASN1/DER Speficiation: https://www.itu.int/rec/T-REC-X.680-X.693-202102-I/en
class DER { class DER {
@ -49,13 +50,13 @@ class DER {
return this._encode(0x02, Buffer.from([data])); return this._encode(0x02, Buffer.from([data]));
} }
static encodeObjectIdentifier(oid: string): Buffer { static encodeObjectIdentifier(oid: string): Buffer {
const parts = oid.split('.').map((v) => Number(v)); const parts = oid.split('.').map(v => Number(v));
// Encode the second part, which could be large, using base-128 encoding if necessary // Encode the second part, which could be large, using base-128 encoding if necessary
const output = [encodeBase128(40 * parts[0] + parts[1])]; const output = [encodeBase128(40 * parts[0] + parts[1])];
for (let i = 2; i < parts.length; i++) { for (let i = 2; i < parts.length; i++)
output.push(encodeBase128(parts[i])); output.push(encodeBase128(parts[i]));
}
return this._encode(0x06, Buffer.concat(output)); return this._encode(0x06, Buffer.concat(output));
} }

View file

@ -29,8 +29,8 @@ import { monotonicTime } from './time';
// Same as in Chromium (https://source.chromium.org/chromium/chromium/src/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88d:net/socket/transport_connect_job.cc;l=102) // Same as in Chromium (https://source.chromium.org/chromium/chromium/src/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88d:net/socket/transport_connect_job.cc;l=102)
const connectionAttemptDelayMs = 300; const connectionAttemptDelayMs = 300;
const kDNSLookupAt = Symbol('kDNSLookupAt') const kDNSLookupAt = Symbol('kDNSLookupAt');
const kTCPConnectionAt = Symbol('kTCPConnectionAt') const kTCPConnectionAt = Symbol('kTCPConnectionAt');
class HttpHappyEyeballsAgent extends http.Agent { class HttpHappyEyeballsAgent extends http.Agent {
createConnection(options: http.ClientRequestArgs, oncreate?: (err: Error | null, socket?: net.Socket) => void): net.Socket | undefined { createConnection(options: http.ClientRequestArgs, oncreate?: (err: Error | null, socket?: net.Socket) => void): net.Socket | undefined {
@ -75,7 +75,7 @@ export async function createTLSSocket(options: tls.ConnectionOptions): Promise<t
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
assert(options.host, 'host is required'); assert(options.host, 'host is required');
if (net.isIP(options.host)) { if (net.isIP(options.host)) {
const socket = tls.connect(options) const socket = tls.connect(options);
socket.on('secureConnect', () => resolve(socket)); socket.on('secureConnect', () => resolve(socket));
socket.on('error', error => reject(error)); socket.on('error', error => reject(error));
} else { } else {
@ -202,5 +202,5 @@ export function timingForSocket(socket: net.Socket | tls.TLSSocket) {
return { return {
dnsLookupAt: (socket as any)[kDNSLookupAt] as number | undefined, dnsLookupAt: (socket as any)[kDNSLookupAt] as number | undefined,
tcpConnectionAt: (socket as any)[kTCPConnectionAt] as number | undefined, tcpConnectionAt: (socket as any)[kTCPConnectionAt] as number | undefined,
} };
} }

View file

@ -163,7 +163,7 @@ function innerAsLocators(factory: LocatorFactory, parsed: ParsedSelector, isFram
continue; continue;
} }
let locatorType: LocatorType = 'default'; const locatorType: LocatorType = 'default';
const nextPart = parts[index + 1]; const nextPart = parts[index + 1];

View file

@ -51,7 +51,6 @@ export function captureRawStack(): RawStack {
export function captureLibraryStackTrace(): { frames: StackFrame[], apiName: string } { export function captureLibraryStackTrace(): { frames: StackFrame[], apiName: string } {
const stack = captureRawStack(); const stack = captureRawStack();
const isTesting = isUnderTest();
type ParsedFrame = { type ParsedFrame = {
frame: StackFrame; frame: StackFrame;
frameText: string; frameText: string;

View file

@ -48,6 +48,7 @@ class ZoneManager {
zones.push(str); zones.push(str);
} }
// eslint-disable-next-line no-console
console.log('zones: ', zones.join(' -> ')); console.log('zones: ', zones.join(' -> '));
} }
} }