mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 09:17:08 +02:00
| .. | ||
| docs/rules | ||
| src | ||
| eslint.config.mjs | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.eslint.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
@n8n/eslint-plugin-community-nodes
ESLint plugin for linting n8n community node packages to ensure consistency and best practices.
Install
npm install --save-dev eslint @n8n/eslint-plugin-community-nodes
**Requires ESLint >=9 and flat config
Usage
See the ESLint docs for more information about extending config files.
Recommended config
This plugin exports a recommended config that enforces good practices.
import { n8nCommunityNodesPlugin } from '@n8n/eslint-plugin-community-nodes';
export default [
// …
n8nCommunityNodesPlugin.configs.recommended,
{
rules: {
'@n8n/community-nodes/node-usable-as-tool': 'warn',
},
},
];
Rules
💼 Configurations enabled in.
⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.
☑️ Set in the recommendedWithoutN8nCloudSupport configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
| Name | Description | 💼 | ⚠️ | 🔧 | 💡 |
|---|---|---|---|---|---|
| ai-node-package-json | Enforce consistency between n8n.aiNodeSdkVersion and ai-node-sdk peer dependency in community node packages | ✅ ☑️ | |||
| cred-class-field-icon-missing | Credential class must have an icon property defined |
✅ ☑️ | 💡 | ||
| credential-documentation-url | Enforce valid credential documentationUrl format (URL or lowercase alphanumeric slug) | ✅ ☑️ | 🔧 | ||
| credential-password-field | Ensure credential fields with sensitive names have typeOptions.password = true | ✅ ☑️ | 🔧 | ||
| credential-test-required | Ensure credentials have a credential test | ✅ ☑️ | 💡 | ||
| icon-validation | Validate node and credential icon files exist, are SVG format, and light/dark icons are different | ✅ ☑️ | 💡 | ||
| missing-paired-item | Require pairedItem on INodeExecutionData objects in execute() methods to preserve item linking. | ✅ ☑️ | |||
| no-credential-reuse | Prevent credential re-use security issues by ensuring nodes only reference credentials from the same package | ✅ ☑️ | 💡 | ||
| no-deprecated-workflow-functions | Disallow usage of deprecated functions and types from n8n-workflow package | ✅ ☑️ | 💡 | ||
| no-forbidden-lifecycle-scripts | Ban lifecycle scripts (prepare, preinstall, postinstall, etc.) in community node packages | ✅ ☑️ | |||
| no-http-request-with-manual-auth | Disallow this.helpers.httpRequest() in functions that call this.getCredentials(). Use this.helpers.httpRequestWithAuthentication() instead. | ✅ ☑️ | |||
| no-restricted-globals | Disallow usage of restricted global variables in community nodes. | ✅ | |||
| no-restricted-imports | Disallow usage of restricted imports in community nodes. | ✅ | |||
| node-class-description-icon-missing | Deprecated. Node class description must have an icon property defined. Use require-node-description-fields instead. |
✅ ☑️ | 💡 | ||
| node-connection-type-literal | Disallow string literals in node description inputs/outputs — use NodeConnectionTypes enum instead |
✅ ☑️ | 🔧 | ||
| node-usable-as-tool | Ensure node classes have usableAsTool property | ✅ ☑️ | 🔧 | ||
| options-sorted-alphabetically | Enforce alphabetical ordering of options arrays in n8n node properties | ✅ ☑️ | |||
| package-name-convention | Enforce correct package naming convention for n8n community nodes | ✅ ☑️ | 💡 | ||
| require-continue-on-fail | Require continueOnFail() handling in execute() methods of node classes | ✅ ☑️ | |||
| require-node-description-fields | Node class description must define all required fields | ✅ ☑️ | |||
| resource-operation-pattern | Enforce proper resource/operation pattern for better UX in n8n nodes | ✅ ☑️ |