Files
next.js/errors
241ac2d62b 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 <[email protected]>
Co-authored-by: Benjamin Woodruff <[email protected]>
2026-04-19 23:25:35 +00:00
..
2025-05-08 13:11:38 +01:00
2025-05-12 08:32:57 -05:00
2025-05-12 08:32:57 -05:00