Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function-eslint doesn't know about Buffer, util and modules imported in functionExternalModules #37

Open
pauldeng opened this issue Aug 25, 2022 · 0 comments

Comments

@pauldeng
Copy link

pauldeng commented Aug 25, 2022

Current Behavior

Similar to issue #22.

The function-eslint rule complains if a function node references Buffer, util and modules imported in functionExternalModules - saying they are not defined.

Expected Behavior

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

Modules added to the Setup page of function should not cause lint errors.

Steps To Reproduce

No response

Example flow

[{"id":"c6aa1fb9b985ec0c","type":"inject","z":"2c71e369871e1bf1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":200,"wires":[["f3c126edd67f2eab"]]},{"id":"f3c126edd67f2eab","type":"function","z":"2c71e369871e1bf1","name":"function 1","func":"msg.payload = Buffer.from('010203', 'hex');\n\nmsg.print = sprintfJs.sprintf(\"hello world %d\", 1234);\n\nmsg.hello = util.format('%s:%s', 'foo', 'bar');\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"sprintfJs","module":"sprintf-js"}],"x":500,"y":200,"wires":[["f13d7e94ed4589f2"]]},{"id":"f13d7e94ed4589f2","type":"debug","z":"2c71e369871e1bf1","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":200,"wires":[]}]

Environment

  • nrlint version: 1.1.0
  • Node-RED version: 3.0.2
  • Node.js version: 16.17
  • npm version: 8.15.0
  • Platform/OS: Ubuntu 20.04
  • Browser: Firefox 103.0
@pauldeng pauldeng changed the title function-eslint doesn't know about Buffer and modules defined in functionExternalModules function-eslint doesn't know about Buffer, util and modules imported in functionExternalModules Aug 25, 2022
@Steve-Mcl Steve-Mcl mentioned this issue Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant