fix(no-navigation-without-resolve): check complete external rel tokens

#1380

Pull request

Merged at Oct 26, 2026, 5:06 AM by ota-meshi
B
baseballyama
Sep 23, 2025, 1:13 PM

no-navigation-without-resolve currently checks only the first chunk of a rel attribute, so rel="external{suffix}" can incorrectly exempt an internal link even when its complete value has no external token.

Check the complete string value instead, using static evaluation where possible. Unknown interpolations cannot create a token boundary; a known, separately delimited external token remains allowed. This also handles template literals and shorthand attributes, avoids a crash on a bare rel attribute, and stops relying on an initializer after the variable has been reassigned.

Internal links with data-sveltekit-reload still require resolve(), including "false", {false}, and enabled reload values. This retains the existing behavior on main and the external-link handling introduced in .

Validation:

  • Full suite: 1467 passing.
  • All 95 rule fixtures independently checked with ESLint 8.57.1, 9.39.1, and 10.0.0, including message locations.
  • JavaScript and TypeScript regression fixtures cover rel token boundaries, unknown interpolations, empty attributes, reassigned variables, and reload values.
  • TypeScript build, ESLint (0 errors; 2 existing unrelated warnings), type coverage (99.06%), Prettier, and diff checks pass.

Related: .

👍 2❤️ 1