Skip to content

Commit b048326

Browse files
committed
fix: move eslint-disable-next-line to cover javascript: string literal
The multi-line if condition moved the 'javascript:' string to a line no longer covered by the eslint-disable-next-line directive. Move the comment inside the if condition so it correctly suppresses no-script-url on the line containing the string literal.
1 parent 426cae7 commit b048326

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react/src/util/sanitizeUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export function sanitizeUrl(inputUrl: string, baseUrl: string): string {
88
try {
99
const url = new URL(inputUrl, baseUrl);
1010

11-
// eslint-disable-next-line no-script-url -- false positive, we are explicitly checking if the protocol is safe to prevent XSS
1211
if (
12+
// eslint-disable-next-line no-script-url -- false positive, we are explicitly checking if the protocol is safe to prevent XSS
1313
url.protocol !== "javascript:" &&
1414
url.protocol !== "data:" &&
1515
url.protocol !== "vbscript:"

0 commit comments

Comments
 (0)