nrlint
nrlint copied to clipboard
Custom Rule Plugins - works fine with the CLI, but is not enabled for Web Editor?
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
- Create a plugin containing a rule
- See that it works with node_modules/nrlint/bin/nrlint.js
- 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.
I dont mind giving a go at it, but I have no idea on where to start.
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.
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?
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.