From de596b2f3e8f1bb54c02ba4b3497ac63e11ea4db Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Mon, 15 Sep 2025 16:48:55 +0200 Subject: [PATCH 1/4] fix: report locations with linebreaks in `no-reference-like-urls` --- src/rules/no-reference-like-urls.js | 96 ++-------------------- tests/rules/no-reference-like-urls.test.js | 8 +- 2 files changed, 13 insertions(+), 91 deletions(-) diff --git a/src/rules/no-reference-like-urls.js b/src/rules/no-reference-like-urls.js index d7a7249c..cabf6737 100644 --- a/src/rules/no-reference-like-urls.js +++ b/src/rules/no-reference-like-urls.js @@ -8,15 +8,13 @@ //----------------------------------------------------------------------------- import { normalizeIdentifier } from "micromark-util-normalize-identifier"; -import { findOffsets } from "../util.js"; //----------------------------------------------------------------------------- // Type Definitions //----------------------------------------------------------------------------- /** - * @import { SourceRange } from "@eslint/core" - * @import { Heading, Paragraph, TableCell } from "mdast"; + * @import { Image, Link } from "mdast"; * @import { MarkdownRuleDefinition } from "../types.js"; * @typedef {"referenceLikeUrl"} NoReferenceLikeUrlMessageIds * @typedef {[]} NoReferenceLikeUrlOptions @@ -29,17 +27,7 @@ import { findOffsets } from "../util.js"; /** Pattern to match both inline links: `[text](url)` and images: `![alt](url)`, with optional title */ const linkOrImagePattern = - /(?<=(?!)?\[(?