Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.05 KB

node-param-default-wrong-for-string.md

File metadata and controls

56 lines (43 loc) · 1.05 KB

node-param-default-wrong-for-string

default for a string-type node parameter must be a string, unless typeOptions.multipleValues is set to true.

📋 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:

const test = {
	displayName: "Test",
	name: "test",
	type: "string",
	default: 1,
};

✅ Example of correct code:

const test = {
	displayName: "Test",
	name: "test",
	type: "string",
	default: "",
};

const test = {
	displayName: "Tags",
	name: "tags",
	type: "string",
	typeOptions: {
		multipleValues: true,
		multipleValueButtonText: "Add Tag",
	},
	default: [],
};

const test = {
	displayName: "Scope",
	name: "scope",
	type: "hidden",
	default: scopes,
};

Links