# Lazy lint on return?

**URL:** https://discourse.nodered.org/t/lazy-lint-on-return/99979
**Category:** General
**Created:** [18 December 2025 13:20 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979 "2025-12-18T13:20:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)
#### Post date: [18 December 2025 13:20 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979/1 "2025-12-18T13:20:04Z")

</div>

Was refactoring some code and naturally linter triggered and show invalid name. This happened while assigning variable (`const a = b`), however it never linted on return (`return b`)! What's going on here? Is it more complicated, error prone or noisy to lint on return? Or is it just too lazy in general? If `b` isn't declared anywhere, I'd like a heads up regardless of where it is referenced.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 December 2025 14:45 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979/2 "2025-12-18T14:45:52Z")

</div>

Can you post an example function please.

---

<div class="post-metadata">

### Author: ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)
#### Post date: [18 December 2025 22:04 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979/3 "2025-12-18T22:04:29Z")

</div>

Something like this:

```javascript
const a = b;
return [a, b];

```

This triggers red line under `b` on line 1. Nothing on return line. I thought perhaps the nr lint tab trigger would include return, but if I change `a = b` to `a = 2`, nr lint disappears. Replacing first `b` with `2` also removes my suspicion that it was lazy and only triggered on first reference.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8cb9d3fb04ec9e155eef401954020d7e9c1adbe6.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 December 2025 16:11 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979/4 "2025-12-22T16:11:21Z")

</div>

That is indeed odd. It seems not to do the checking in the return statement. This shows errors on b as expected  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19c76f509f4325e4afd7426986a5be36ded3520a.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [22 March 2026 16:11 UTC](https://discourse.nodered.org/t/lazy-lint-on-return/99979/5 "2026-03-22T16:11:53Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
