refactor: Bring lint config back to original strictness

This commit is contained in:
Joachim Van Herwegen
2023-10-30 14:32:21 +01:00
parent 7a007dc466
commit 3bb3004abb
52 changed files with 239 additions and 132 deletions

View File

@@ -38,7 +38,7 @@ export function isGuarded<T extends NodeJS.EventEmitter>(stream: T): stream is G
function guardingErrorListener(this: Guarded, error: Error): void {
// Only fall back to this if no new listeners are attached since guarding started.
const errorListeners = this.listeners('error');
if (errorListeners[errorListeners.length - 1] === guardingErrorListener) {
if (errorListeners.at(-1) === guardingErrorListener) {
this[guardedErrors].push(error);
if (!this[guardedTimeout]) {
this[guardedTimeout] = setTimeout((): void => {

View File

@@ -38,7 +38,7 @@ const logger = getLoggerFor('HeaderUtil');
export function transformQuotedStrings(input: string): { result: string; replacements: Record<string, string> } {
let idx = 0;
const replacements: Record<string, string> = {};
const result = input.replace(/"(?:[^"\\]|\\.)*"/gu, (match): string => {
const result = input.replaceAll(/"(?:[^"\\]|\\.)*"/gu, (match): string => {
// Not all characters allowed in quoted strings, see BNF above
if (!QUOTED_STRING.test(match)) {
logger.warn(`Invalid quoted string in header: ${match}`);

View File

@@ -173,7 +173,6 @@ async function findNextSorted<T>(iterators: AsyncIterator<T>[], results: (T | un
export async function* sortedAsyncMerge<T>(iterators: AsyncIterator<T>[], comparator?: (left: T, right: T) => number):
AsyncIterable<T> {
if (!comparator) {
// eslint-disable-next-line style/no-extra-parens
comparator = (left, right): number => left < right ? -1 : (left > right ? 1 : 0);
}

View File

@@ -15,7 +15,7 @@ import { errorTermsToMetadata } from './errors/HttpErrorUtil';
* @returns The potentially changed path (POSIX).
*/
function windowsToPosixPath(path: string): string {
return path.replace(/\\+/gu, '/');
return path.replaceAll(/\\+/gu, '/');
}
/**

View File

@@ -16,7 +16,7 @@ export function splitCommaSeparated(input: string): string[] {
* @returns The sanitized output.
*/
export function sanitizeUrlPart(urlPart: string): string {
return urlPart.replace(/\W/gu, '-');
return urlPart.replaceAll(/\W/gu, '-');
}
/**

View File

@@ -51,7 +51,7 @@ export type VocabularyTerm<T> = T extends Vocabulary<any, infer TKey> ? T['terms
*/
function createValueVocabulary<TBase extends string, TLocal extends string>(baseUri: TBase, localNames: TLocal[]):
ValueVocabulary<TBase, TLocal> {
const expanded: Partial<ExpandedRecord<TBase, TLocal>> = { };
const expanded: Partial<ExpandedRecord<TBase, TLocal>> = {};
// Expose the listed local names as properties
for (const localName of localNames) {
expanded[localName] = `${baseUri}${localName}`;