Skip to content

Latest commit

 

History

History
124 lines (111 loc) · 2.3 KB

node-class-description-credentials-name-unsuffixed.md

File metadata and controls

124 lines (111 loc) · 2.3 KB

node-class-description-credentials-name-unsuffixed

name under credentials in node class description must be suffixed with -Api.

📋 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: ["main"],
		credentials: [
			{
				name: "testOAuth2",
			},
			{
				name: "testApi",
			},
		],
	};
}

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"],
		credentials: [
			{
				name: "testOAuth2Ap",
			},
			{
				name: "testApi",
			},
		],
	};
}

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"],
		credentials: [
			{
				name: "testOAuth2A",
			},
			{
				name: "testApi",
			},
		],
	};
}

✅ 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"],
		credentials: [
			{
				name: "testOAuth2Api",
			},
			{
				name: "testApi",
			},
		],
	};
}

Links