String literals in node inputs/outputs now auto-fixed

A new ESLint rule in the community nodes plugin flags hardcoded strings like 'main' in node descriptions and replaces them with the NodeConnectionTypes enum automatically.
When community node developers use raw string literals like 'main' in their node's inputs and outputs properties, they bypass type checking entirely. Typos or renamed connection types slip through undetected until runtime.
The @n8n/eslint-plugin-community-nodes plugin now includes a rule that catches these string literals and suggests — or auto-fixes — the appropriate NodeConnectionTypes enum value instead. The rule derives its mapping directly from n8n-workflow at runtime, so it stays synchronized as new connection types are added without requiring updates to the rule itself.
In the eslint-plugin-community-nodes package, the rule is enabled at the error level across both recommended configurations. Developers running the linter against their node code will see immediate suggestions to replace hardcoded strings with the enum reference, and can apply fixes automatically with eslint --fix.
This is part of a broader push to enforce consistency and catch bugs early in the node development workflow.
View Original GitHub Description
Summary
Adds a new ESLint rule node-connection-type-literal to @n8n/eslint-plugin-community-nodes that flags string literals (e.g. 'main') in node description inputs and outputs properties and requires using the NodeConnectionTypes enum from n8n-workflow instead. The rule provides an auto-fix for all known connection type values. It is enabled as error in both recommended configs.
The reverse mapping from string value to enum key is derived directly from NodeConnectionTypes at runtime, so it stays in sync automatically as new connection types are added.
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
release/backport(if the PR is an urgent fix that needs to be backported)