Skip to content

Latest commit

 

History

History
90 lines (78 loc) · 1.7 KB

node-class-description-missing-subtitle.md

File metadata and controls

90 lines (78 loc) · 1.7 KB

node-class-description-missing-subtitle

subtitle in node class description must be present.

📋 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,
		description: "This is a sentence",
		defaults: {
			name: "Test",
		},
		inputs: ["main"],
		outputs: ["main"],
		properties: [
			{
				displayName: "Resource",
			},
			{
				displayName: "Operation",
			},
		],
	};
}

✅ 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"],
		properties: [
			{
				displayName: "Resource",
			},
			{
				displayName: "Operation",
			},
		],
	};
}

class TestTriggerNode {
	description = {
		displayName: "Test Trigger",
		name: "testTrigger",
		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