Nrlint@1.0.1: What is wrong with this JSON?

I am testing nrlint@1.0.1 with node-red@2.0.0.

The inject node displays an exclamation mark with linting error.

However, the JSON seems to be correct as it is accepted.

{
    "Epoch": 1583082974,
    "Report": [
        {
            "Data": {
                "Name": "Indoor",
                "Epoch": 1583082500,
                "Temperature": 23.1,
                "Humidity": 75.5,
                "RSSI": -85
            }
        },
        {
            "Data": {
                "Name": "Outdoor",
                "Epoch": 1583082648,
                "Temperature": 27.6,
                "Humidity": 57.1,
                "RSSI": -82
            }
        }
    ]
}

What is wrong with this JSON? Thank you!

Can you export the inject node and paste it here please so we can check it.

Sure, please find the export from the inject node:

[
    {
        "id": "c9e75916.98c388",
        "type": "inject",
        "z": "6bda371c.9dc02",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"Epoch\":1583082974,\"Report\":[{\"Data\":{\"Name\":\"Indoor\",\"Epoch\":1583082500,\"Temperature\":23.1,\"Humidity\":75.5,\"RSSI\":-85}},{\"Data\":{\"Name\":\"Outdoor\",\"Epoch\":1583082648,\"Temperature\":27.6,\"Humidity\":57.1,\"RSSI\":-82}}]}",
        "payloadType": "json",
        "x": 160,
        "y": 100,
        "wires": [
            [
                "4c3e4db.a99d6b4",
                "826a0b68.9cd1a8"
            ]
        ]
    }
]

If you open the linter sidebar panel it will tell you.

You can also access the sidebar by clicking on the lint summary in the footer of the workspace:

image

Could it be possible to highlight the error in the sidebar by clicking the yellow icon on the node? I had over 500 to start with, was difficult to find what was going on.

1 Like

Not at the moment, otherwise I would have implemented it :slight_smile:

Needs some changes in the core Node-RED to support clickable actions on node annotations.

It doesn't seem to be working too well for me. I have 460 errors or thereabouts, mostly grid alignment errors. When I open the linter settings and clear the checkbox for that error then all errors disappear (including errors other than alignment) though the error count stays the same. Running Firefox.

By turning off the align-to-grid rule, the other rules do fail.
Also it seems to me that flows at the disabled tab also linted. Don't know if it is intentional or bug but doesn't seem most logical thing...

Computer has crashed twice now, trying to figure out if there is something related. Took the forced windows updates just before installing the NR 2.0.1 and linter and debbuger.

Edit 2
Crashes are not related (got incomplete windows update) but behavior still remains.
Change of rule set, specially the align-to-grid rule do break other rules
By refresh the browser tab when align-to-grid rule is not enabled, none of rules apply.

Edit 3
Errors in console

Turning of the grid rule gives following

Which ends with:

nrlint@1.0.2 now published that fixes the crash when alignToGrid rule is disabled.

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