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

Custom Rule Plugins - works fine with the CLI, but is not enabled for Web Editor? #28

Open
andreasmarkussen opened this issue Dec 10, 2021 · 4 comments

Comments

@andreasmarkussen
Copy link

andreasmarkussen commented Dec 10, 2021

Current Behavior

I was expecting that I could create a custom NRLint rule, and use it both for web and cli.
However, the Web Editor does not take the "plugins" key into account.

Expected Behavior

I would expect that custom rules would be possible to load in the Web editor.

Steps To Reproduce

  1. Create a plugin containing a rule
  2. See that it works with node_modules/nrlint/bin/nrlint.js
  3. See that it does not work on the web

Example flow

paste your flow here

Environment

  • nrlint version: 1.02
  • Node-RED version: 2.1.4
  • Node.js version: v14.17.0
  • npm version: 8.1.4
  • Platform/OS: Windows
  • Browser: Chrome

PS. Love the concept of the NRLint.

@andreasmarkussen
Copy link
Author

I dont mind giving a go at it, but I have no idea on where to start.

@andreasmarkussen
Copy link
Author

andreasmarkussen commented Dec 10, 2021

And if someone wants to do a PR that can enable custom lint plugins in the UI, then let me know. I would be able to sponsor it financially.

@andreasmarkussen
Copy link
Author

I have now been through the NRLint code, and I can see that the loading of custom plugins is not covered by the current code in the nrlint-worker.js file, and I can see perhaps the custom rule needs to be webpacked, in order to get it into the browser?

@k-toumura
Copy link
Contributor

Thank you for using nrlint!

To use the rule module from the browser, currently nrlint uses Webpack. I've made a simple example of a rule plugin. I hope this will help you to create your own rule plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants