node-red / nrlint

Node-RED Flow Linter
Apache License 2.0
36 stars 15 forks source link

function-eslint doesn't know about all the built-in objects we provide #22

Closed knolleary closed 2 years ago

knolleary commented 2 years ago

Current Behavior

The function-eslint rule complains if a function node references flow, global, context, env or RED - saying they are not defined.

Expected Behavior

Any built-in object the Function node provides should not cause lint errors.

Steps To Reproduce

No response

Example flow

[{"id":"a0b5c25ababe35ba","type":"function","z":"912a8b17fa6a48c6","name":"","func":"let a = flow.get(\"foo\");\nlet b = global.get(\"foo\");\nlet c = context.get(\"foo\");\nlet d = env.get(\"env\");\nlet e = RED.util.cloneMessage(msg);\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":100,"wires":[[]]}]

Environment