Skip to content

Commit 8954dfc

Browse files
committed
Fixed linting errors
no-issue Removed unused catch binding variables and added eslint-disable comments for require() imports that are needed for type compatibility.
1 parent 6680b67 commit 8954dfc

File tree

7 files changed

+9
-4
lines changed

7 files changed

+9
-4
lines changed

packages/url-utils/src/utils/absolute-to-relative.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const absoluteToRelative = function absoluteToRelative(url: string, rootUrl?: st
4747
if (parsedUrl.origin === 'null' || parsedUrl.origin === 'http://relative') {
4848
return url;
4949
}
50-
} catch (e) {
50+
} catch {
5151
return url;
5252
}
5353

packages/url-utils/src/utils/absolute-to-transform-ready.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function isRelative(url: string): boolean {
1717
let parsedInput: URL;
1818
try {
1919
parsedInput = new URL(url, 'http://relative');
20-
} catch (e) {
20+
} catch {
2121
// url was unparseable
2222
return false;
2323
}

packages/url-utils/src/utils/html-transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {HtmlTransformOptions, HtmlTransformOptionsInput, UrlTransformFunction} from './types';
2+
// eslint-disable-next-line @typescript-eslint/no-require-imports
23
const cheerio = require('cheerio');
34

45
function escapeRegExp(string: string): string {

packages/url-utils/src/utils/lexical-transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {LexicalTransformOptions, LexicalTransformOptionsInput, LexicalUrlTransformMap, UrlTransformFunction} from './types';
2+
// eslint-disable-next-line @typescript-eslint/no-require-imports
23
const _ = require('lodash');
34

45
// options.transformMap = {

packages/url-utils/src/utils/markdown-transform.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type {MarkdownTransformOptions, MarkdownTransformOptionsInput, MarkdownTransformFunctions} from './types';
2+
/* eslint-disable @typescript-eslint/no-require-imports */
23
let remark: typeof import('remark') | undefined;
34
const footnotes = require('remark-footnotes');
45
const visit = require('unist-util-visit');
6+
/* eslint-enable @typescript-eslint/no-require-imports */
57

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

4244
if (!remark) {
45+
// eslint-disable-next-line @typescript-eslint/no-require-imports
4346
remark = require('remark');
4447
}
4548

packages/url-utils/src/utils/relative-to-absolute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const relativeToAbsolute = function relativeToAbsolute(
7373
if (path.lastIndexOf('//', 0) === 0) {
7474
return path;
7575
}
76-
} catch (e) {
76+
} catch {
7777
return path;
7878
}
7979

packages/url-utils/src/utils/strip-subdirectory-from-path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const stripSubdirectoryFromPath = function stripSubdirectoryFromPath(path: strin
1717

1818
try {
1919
parsedRoot = new URL(rootUrl);
20-
} catch (e) {
20+
} catch {
2121
return path;
2222
}
2323

0 commit comments

Comments
 (0)