# Fixing nrlint findings

**URL:** <https://discourse.nodered.org/t/fixing-nrlint-findings/50311>\
**Category:** General\
**Created:** [28 August 2021 04:33 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311 "2021-08-28T04:33:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![augjoh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/augjoh/32/26464_2.png) [@augjoh](https://discourse.nodered.org/u/augjoh)\
**Post date:** [28 August 2021 04:33 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/1 "2021-08-28T04:33:02Z")

</div>

I've tried to run nrlint against my flows and got the following output:

```auto
> npx nrlint flows.json
╔═════════════════╤══════════╤═══════════════════════════════════════════════════════════════════════╤═══════════════════════════╗
║ Object ID │ Severity │ Message │ Rule ║
╟─────────────────┼──────────┼───────────────────────────────────────────────────────────────────────┼───────────────────────────╢
║ 7950deec.712db │ error │ Definition for rule 'security/detect-object-injection' was not found. │ function-eslint ║
║ 7950deec.712db │ error │ Definition for rule 'security/detect-object-injection' was not found. │ function-eslint ║
║ 7c737c87.dad544 │ error │ Parsing error: Unexpected token transport │ function-eslint ║
║ e9d868fe.2e65d8 │ warn │ Unconnected HTTP Response node │ no-unconnected-http-nodes ║
╚═════════════════╧══════════╧═══════════════════════════════════════════════════════════════════════╧═══════════════════════════╝
✖ 4 problems (3 errors, 1 warnings)

```

No I'm struggeling to find out, how to correct these errors. What is the meaning of the first two messages?

How can I correct the last warning? `e9d868fe.2e65d8` is the upper right http node in the next image. I've highlighted the nodes, which could throw errors and send messages to `e9d868fe.2e65d8` from the `catch: 5` node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/4358c3a369edc1faaeed6e79b2241e6207f0a03d.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 August 2021 06:19 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/2 "2021-08-28T06:19:46Z")

</div>

> [@augjoh](#):
>
> No I'm struggeling to find out, how to correct these errors. What is the meaning of the first two messages?

Impossible to help without seeing your function code.

> [@augjoh](#):
>
> How can I correct the last warning? `e9d868fe.2e65d8` is the upper right http node in the next image

Every http-response node must be connected to a http-in node. The reason is because the `msg` that is generated in the http-in node (by calling the endpoint) contains the necessary info to correctly respond to the caller.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 August 2021 07:20 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/3 "2021-08-28T07:20:01Z")

</div>

> [@augjoh](#):
>
> How can I correct the last warning? `e9d868fe.2e65d8` is the upper right http node in the next image. I've highlighted the nodes, which could throw errors and send messages to `e9d868fe.2e65d8` from the `catch: 5` node.

In this instance, you've got a false positive warning. The lint rule is currently just looking at directly wired nodes - it doesn't know about catch nodes.

In the lint sidebar in the editor you can tell it to ignore that warning for that node.

---

<div class="post-metadata">

**Author:** ![augjoh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/augjoh/32/26464_2.png) [@augjoh](https://discourse.nodered.org/u/augjoh)\
**Post date:** [28 August 2021 07:31 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/4 "2021-08-28T07:31:36Z")

</div>

> [@Steve-Mcl](#):
>
> > [@augjoh](#):
> >
> > No I'm struggeling to find out, how to correct these errors. What is the meaning of the first two messages?
> 
> Impossible to help without seeing your function code.

This message is coming from [eslint](https://github.com/eslint/eslint/blob/41617ec3c4bc8bd1ba5f66521185be1566e6f5f4/lib/linter/linter.js) line 214. It isn't generated when running eslint on the code, although the same rule is triggered there as well.

---

<div class="post-metadata">

**Author:** ![augjoh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/augjoh/32/26464_2.png) [@augjoh](https://discourse.nodered.org/u/augjoh)\
**Post date:** [28 August 2021 07:33 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/5 "2021-08-28T07:33:13Z")

</div>

> [@knolleary](#):
>
> > [@augjoh](#):
> >
> > How can I correct the last warning? `e9d868fe.2e65d8` is the upper right http node in the next image. I've highlighted the nodes, which could throw errors and send messages to `e9d868fe.2e65d8` from the `catch: 5` node.
> 
> In this instance, you've got a false positive warning. The lint rule is currently just looking at directly wired nodes - it doesn't know about catch nodes.
> 
> In the lint sidebar in the editor you can tell it to ignore that warning for that node.

I haven't integated nrlint into my flows, yet. Is it possible to configure this for the command line tool somehow?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 August 2021 08:51 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/6 "2021-08-28T08:51:09Z")

</div>

To ignore a rule for a particular node, you can add the following to its description field in the editor:

```auto
// nrlint no-unconnected-http-nodes:off

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa404ff803094f93b89317a65ee672b41ea93b38.png)

---

<div class="post-metadata">

**Author:** ![augjoh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/augjoh/32/26464_2.png) [@augjoh](https://discourse.nodered.org/u/augjoh)\
**Post date:** [29 August 2021 10:36 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/7 "2021-08-29T10:36:21Z")

</div>

@knolleary This works well and suppresses the message.

@Steve-Mcl Any idea, what's behind the other two messages?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 August 2021 12:07 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/8 "2021-08-29T12:07:34Z")

</div>

> [@augjoh](#):
>
> Any idea, what's behind the other two messages

No. As I said...

> [@Steve-Mcl](#):
>
> Impossible to help without seeing your function code

... You haven't shown us what's in the function node that this error is pointing to yet.

---

<div class="post-metadata">

**Author:** ![augjoh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/augjoh/32/26464_2.png) [@augjoh](https://discourse.nodered.org/u/augjoh)\
**Post date:** [4 September 2021 03:48 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/9 "2021-09-04T03:48:32Z")

</div>

Here is a minimal flow triggering this message:

```auto
[{"id":"fe99bf67ff84552f","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7216987ec3d13f16","type":"function","z":"fe99bf67ff84552f","name":"Name","func":"/* eslint-disable security/detect-object-injection */\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":140,"wires":[]},{"id":"7409bcddd1b3500a","type":"inject","z":"fe99bf67ff84552f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":140,"wires":[["7216987ec3d13f16"]]}]

```

It looks like a configuration issue. How can I add the missing plugin to nrlint?

---

<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:** [3 November 2021 03:49 UTC](https://discourse.nodered.org/t/fixing-nrlint-findings/50311/10 "2021-11-03T03:49:24Z")

</div>

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