All skills
n8n-io avatar

/create-community-node-lint-rule

@b4d898e official
by n8n - Workflow Automationn8n-io/n8n206k stars
60,960

Create new ESLint rules for the @n8n/eslint-plugin-community-nodes package. Use when adding a lint rule, creating a community node lint, or working on eslint-plugin-community-nodes. Guides rule implementation, tests, docs, and plugin registration.

  • 2 files
  • 9.9 KB
  • Updated 5 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/n8n-io/n8n/create-community-node-lint-rule

This session only. Nothing lands on disk.

reference.md

≈922 tokens on demand. Your agent reads this file only when SKILL.md points to it.

AST & File Utilities Reference

Helpers available from ../utils/index.js. Use these instead of writing custom AST traversal.

ast-utils.ts

Class/Interface detection

Function Returns Use when
isNodeTypeClass(node) boolean Check if class implements INodeType or extends Node
isCredentialTypeClass(node) boolean Check if class implements ICredentialType

Property finding

Function Returns Use when
findClassProperty(node, name) PropertyDefinition | null Find a property on a class (e.g. description, icon)
findObjectProperty(obj, name) Property | null Find a property in an object literal (Identifier key)
findJsonProperty(obj, name) Property | null Find a property with a Literal key (JSON-style "key")
findArrayLiteralProperty(obj, name) Property | null Find a property whose value is an ArrayExpression

Value extraction

Function Returns Use when
getLiteralValue(node) string | boolean | number | null Extract primitive from a Literal node
getStringLiteralValue(node) string | null Extract string specifically
getBooleanLiteralValue(node) boolean | null Extract boolean specifically
getModulePath(node) string | null Get import path from string literal or template literal

Array operations

Function Returns Use when
hasArrayLiteralValue(arr, value) boolean Check if array contains a specific string literal
extractCredentialInfoFromArray(element) { name, testedBy } | null Parse credential object from array element
extractCredentialNameFromArray(element) string | null Get just the credential name from array element

Method matching

Function Returns Use when
isThisHelpersAccess(node) boolean Match this.helpers member expression
isThisMethodCall(node, method) boolean Match this.methodName(...) calls
isThisHelpersMethodCall(node, method) boolean Match this.helpers.methodName(...) calls

Similarity

Function Returns Use when
findSimilarStrings(target, candidates, maxDistance?) string[] Suggest similar names (Levenshtein distance)

file-utils.ts

Path operations

Function Use when
isContainedWithin(child, parent) Check path is within a directory
safeJoinPath(base, ...parts) Join paths with traversal prevention

Package.json

Function Returns Use when
findPackageJson(startDir) string | null Walk up to find nearest package.json
readPackageJsonN8n(startDir) N8nPackageJson | null Parse n8n config section
readPackageJsonCredentials(startDir) Set<string> Get credential names from package.json
readPackageJsonNodes(startDir) string[] Get resolved node file paths

File system

Function Use when
validateIconPath(filePath, iconValue) Check icon file exists and is SVG
extractCredentialNameFromFile(filePath) Parse credential class name from file
fileExistsWithCaseSync(filePath) Case-sensitive existence check
findSimilarSvgFiles(dir, name) Suggest similar SVG filenames

Credential verification

Function Use when
areAllCredentialUsagesTestedByNodes(startDir) Check all credentials have testedBy

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at b4d898e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 5 months ago
  • TypeScript
  • eslint
  • eslint-plugin
  • n8n
  • community-nodes
  • ast
  • linting
  • rule-creation

README badge

README badge for n8n-io/n8n/create-community-node-lint-rule

Implement new ESLint rules for the n8n community node linter plugin, including rule logic, tests, documentation, and plugin registration. Used when extending @n8n/eslint-plugin-community-nodes to enforce coding patterns in n8n node implementations.

Generated from the current SKILL.md.

Does this skill work with TypeScript ESLint rules?
Yes. The skill guides creating ESLint rules for the @n8n/eslint-plugin-community-nodes package using @typescript-eslint/utils and TypeScript AST utilities.
Can I make a rule that auto-fixes violations?
Yes. Rules can be marked `fixable: 'code'` in the meta object, and the `fix()` callback in `context.report()` provides the fixer methods.
What scope do community node lint rules typically target?
Rules apply to `.node.ts` files and credential classes that implement INodeType or ICredentialType. The skill provides AST helpers like `isNodeTypeClass()` and `isCredentialTypeClass()` to filter the right targets.
Do I need to add my rule to both ESLint configs?
Usually yes—add to both `recommended` and `recommendedWithoutN8nCloudSupport` unless your rule depends on n8n cloud features, in which case add only to `recommended`.
What testing framework does this skill use?
The skill uses @typescript-eslint/rule-tester for unit tests and includes patterns for mocking file utilities and testing both valid and invalid code cases.

Generated from the current SKILL.md. These answers refresh after source changes.