next.js
241ac2d6 - New ESLint rule: `no-location-assign-relative-destination` (#92900)

Commit
20 days ago
New ESLint rule: `no-location-assign-relative-destination` (#92900) ## For Contributors ### Adding a feature Adding a new ESLint rule to `eslint-plugin-next` reporting `location.href = [relative URL]` or `location.assign([relative URL])` usage. For some reason, some LLM models prefer this incorrect pattern, and avoid `redirect()` or `useRouter().push()` at all costs. But at least many of them do respect ESLint, by adding a new rule we can enforce correct behavior. The error documentation and unit test cases are also added. --------- Co-authored-by: Joseph <sephxd1234@gmail.com> Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
Author
Parents
Loading