Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.28 KB

node-class-description-outputs-wrong.md

File metadata and controls

58 lines (47 loc) · 1.28 KB

node-class-description-outputs-wrong

The number of outputs in node class description for any node must be one, or two for If node, or four for Switch node.

📋 This rule is part of the plugin:n8n-nodes-base/nodes config.

🔧 Run ESLint with --fix option to autofix the issue flagged by this rule.

Examples

❌ Example of incorrect code:

class TestNode {
	description = {
		displayName: "Test",
		name: "test",
		icon: "file:test.svg",
		group: ["transform"],
		version: 1,
		subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
		description: "This is a sentence",
		defaults: {
			name: "Test",
		},
		inputs: ["main"],
		outputs: [],
	};
}

✅ Example of correct code:

class TestNode {
	description = {
		displayName: "Test",
		name: "test",
		icon: "file:test.svg",
		group: ["transform"],
		version: 1,
		subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
		description: "This is a sentence",
		defaults: {
			name: "Test",
		},
		inputs: ["main"],
		outputs: ["main"],
	};
}

Links