Skip to content
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
2 changes: 1 addition & 1 deletion packages/url-utils/src/utils/absolute-to-relative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const absoluteToRelative = function absoluteToRelative(url: string, rootUrl?: st
if (parsedUrl.origin === 'null' || parsedUrl.origin === 'http://relative') {
return url;
}
} catch (e) {
} catch {
return url;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function isRelative(url: string): boolean {
let parsedInput: URL;
try {
parsedInput = new URL(url, 'http://relative');
} catch (e) {
} catch {
// url was unparseable
return false;
}
Expand Down
1 change: 1 addition & 0 deletions packages/url-utils/src/utils/html-transform.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {HtmlTransformOptions, HtmlTransformOptionsInput, UrlTransformFunction} from './types';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const cheerio = require('cheerio');

function escapeRegExp(string: string): string {
Expand Down
1 change: 1 addition & 0 deletions packages/url-utils/src/utils/lexical-transform.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {LexicalTransformOptions, LexicalTransformOptionsInput, LexicalUrlTransformMap, UrlTransformFunction} from './types';
// eslint-disable-next-line @typescript-eslint/no-require-imports
const _ = require('lodash');

// options.transformMap = {
Expand Down
3 changes: 3 additions & 0 deletions packages/url-utils/src/utils/markdown-transform.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type {MarkdownTransformOptions, MarkdownTransformOptionsInput, MarkdownTransformFunctions} from './types';
/* eslint-disable @typescript-eslint/no-require-imports */
let remark: typeof import('remark') | undefined;
const footnotes = require('remark-footnotes');
const visit = require('unist-util-visit');
/* eslint-enable @typescript-eslint/no-require-imports */

function replaceLast(find: string, replace: string, str: string): string {
const lastIndex = str.lastIndexOf(find);
Expand Down Expand Up @@ -40,6 +42,7 @@ function markdownTransform(
const replacements: Replacement[] = [];

if (!remark) {
// eslint-disable-next-line @typescript-eslint/no-require-imports
remark = require('remark');
}

Expand Down
2 changes: 1 addition & 1 deletion packages/url-utils/src/utils/relative-to-absolute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const relativeToAbsolute = function relativeToAbsolute(
if (path.lastIndexOf('//', 0) === 0) {
return path;
}
} catch (e) {
} catch {
return path;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const stripSubdirectoryFromPath = function stripSubdirectoryFromPath(path: strin

try {
parsedRoot = new URL(rootUrl);
} catch (e) {
} catch {
return path;
}

Expand Down