Example rule plugin for nrlint.
This rule counts the number of function nodes in a flow, and emit warning when the number > 10.
% gh repo clone k-toumura/nrlint-plugin-rules-example
% cd nrlint-plugin-rules-example
% npm install
% npm run build
% cd ~/.node-red
% npm install <path-to-this-plugin>
% npm install -g <path-to-this-plugin> # need to use from CLI
add following setting to ~/.node-red/.nrlintrc.js
module.export = {
"plugins": [
"nrlint-plugin-rules-example"
],
"rules": {
"example-rule": true,
// ...
}
}
Restart Node-RED, or
% npx nrlint myFlowFile.json
in ~/.node-red
.