Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

eslint-plugin-n8n-nodes-base

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-n8n-nodes-base

[![NPM version](https://img.shields.io/npm/v/eslint-plugin-n8n-nodes-base.svg?style=flat)](https://npmjs.org/package/eslint-plugin-n8n-nodes-base) [![Actions Status](https://github.com/ivov/eslint-plugin-n8n-nodes-base/workflows/checks/badge.svg)](https:/

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-10.87%
Maintainers
1
Weekly downloads
ย 
Created
Source

eslint-plugin-n8n-nodes-base

NPM version Actions Status

ESLint plugin for linting n8n nodes.

Usage

Required: ESLint VSCode extension

  1. Install this plugin:
npm i -D eslint-plugin-n8n-nodes-base
  1. Choose one of the three plugin configs:
  • recommended (all rules)
  • ๐ŸŸข autofixable-safe (does not cause breaking changes)
  • ๐Ÿ”ด autofixable-unsafe (causes breaking changes)
  • ๐Ÿ”ต non-autofixable (to be manually fixed)
  1. Create the ESLint configuration file.

The following example...

  • provides the n8n-nodes-base plugin,
  • enables the rules tagged recommended, and
  • disables a specific rule from the enabled set.
{
  plugins: [ "eslint-plugin-n8n-nodes-base" ],
  extends: [ "plugin:n8n-nodes-base/recommended" ],
  rules: {
    "n8n-nodes-base/node-param-type-options-missing-from-limit": "off"
  }
}

Optionally, omit extends and enable rules individually:

{
  plugins: [ "eslint-plugin-n8n-nodes-base" ],
  rules: {
    "n8n-nodes-base/node-param-type-options-missing-from-limit": "error"
    "n8n-nodes-base/node-param-resource-without-no-data-expression": "error"
    "n8n-nodes-base/node-param-resource-with-plural-option": "error"
  }
}

Ruleset

Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย DescriptionAutofixable
cred-class-field-display-name-miscaseddisplayName field in credential class must be title cased.๐ŸŸข
cred-class-field-display-name-missing-apidisplayName field in credential class must be end with API.๐ŸŸข
cred-class-field-display-name-missing-oauth2displayName field in credential class must mention OAuth2 if applicable.๐Ÿ”ต
cred-class-field-documentation-url-miscaseddocumentationUrl field in credential class must be camel cased.๐ŸŸข
cred-class-field-documentation-url-missingdocumentationUrl field in credential class must be present.๐ŸŸข
cred-class-field-name-missing-oauth2name field in credential class must mention OAuth2 if applicable.๐Ÿ”ต
cred-class-field-name-unsuffixedname field in credential class must be suffixed with -Api.๐Ÿ”ด
cred-class-field-name-uppercase-first-charFirst char in name in credential class must be lowercase.๐Ÿ”ด
cred-class-field-placeholder-url-missing-egplaceholder for a URL in credential class must be prepended with e.g..๐ŸŸข
cred-class-name-missing-oauth2-suffixCredential class name must mention OAuth2 if applicable.๐Ÿ”ต
cred-class-name-unsuffixedCredential class name must be suffixed with -Api.๐Ÿ”ด
filesystem-wrong-cred-filenameCredentials filename must match credentials class name, excluding the filename suffix. Example: TestApi.credentials.ts matches TestApi in class TestApi implements ICredentialType.๐Ÿ”ต
filesystem-wrong-node-dirnameNode dirname must match node filename, excluding the filename suffix. Example: Test node dirname matches Test.node.ts node filename.๐Ÿ”ต
filesystem-wrong-node-filenameNode filename must match name in node class description, excluding the filename suffix. Example: Test.node.ts matches Test in Test.description.name.๐Ÿ”ต
filesystem-wrong-resource-description-filenameResource description file must use singular form. Example: UserDescription.ts, not UsersDescription.ts.๐Ÿ”ต
node-class-description-credentials-name-unsuffixedname under credentials in node class description must be suffixed with -Api.๐ŸŸข
node-class-description-display-name-unsuffixed-trigger-nodedisplayName in node class description for trigger node must be suffixed with -Trigger.๐ŸŸข
node-class-description-empty-stringdescription in node class description must be filled out.๐Ÿ”ต
node-class-description-icon-not-svgicon in node class description should be a non-SVG icon.๐Ÿ”ต
node-class-description-inputs-wrong-regular-nodeThe number of inputs in node class description for regular node should be one, or two for Merge node.๐ŸŸข
node-class-description-inputs-wrong-trigger-nodeThe number of inputs in node class description for trigger node should be zero.๐ŸŸข
node-class-description-missing-subtitlesubtitle in node class description must be present.๐ŸŸข
node-class-description-name-unsuffixed-trigger-nodename in node class description for trigger node must be suffixed with -Trigger.๐ŸŸข
node-class-description-outputs-wrongThe number of outputs in node class description for any node must be one, or two for If node, or four for Switch node.๐ŸŸข
node-execute-block-missing-continue-on-failThe execute() method in a node must implement continueOnFail in a try-catch block.๐Ÿ”ต
node-execute-block-wrong-error-thrownThe execute() method in a node may only throw NodeApiError for failed network requests and NodeOperationError for internal errors, not the built-in Error.๐Ÿ”ต
node-param-array-type-assertionArray of node parameters must be typed, not type-asserted.๐Ÿ”ด
node-param-collection-type-unsorted-itemsItems in collection-type node parameter must be alphabetized by name if more than five.๐ŸŸข
node-param-color-type-unusedcolor-type must be used for color-related node parameter.๐Ÿ”ด
node-param-default-missingdefault must be present in a node parameter.๐ŸŸข
node-param-default-wrong-for-booleandefault for boolean-type node parameter must be a boolean.๐ŸŸข
node-param-default-wrong-for-collectiondefault for collection-type node parameter must be an object.๐ŸŸข
node-param-default-wrong-for-fixed-collectiondefault for fixed-collection-type node parameter must be an object.๐ŸŸข
node-param-default-wrong-for-limitdefault for a Limit node parameter must be 50๐ŸŸข
node-param-default-wrong-for-multi-optionsdefault for a multi-options-type node parameter must be an array.๐ŸŸข
node-param-default-wrong-for-numberdefault for a number-type node parameter must be a number.๐ŸŸข
node-param-default-wrong-for-optionsdefault for an options-type node parameter must be one of the options.๐ŸŸข
node-param-default-wrong-for-simplifydefault for a Simplify node parameter must be true.๐ŸŸข
node-param-default-wrong-for-stringdefault for a string-type node parameter must be a string.๐ŸŸข
node-param-description-boolean-without-whetherdescription in a boolean node parameter must start with Whether.๐Ÿ”ต
node-param-description-empty-stringdescription in node parameter or in option in options-type and multi-options-type param must be filled out or removed. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-excess-final-perioddescription in node parameter must end without a final period if a single-sentence description. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-excess-inner-whitespacedescription in node parameter must not contain excess inner whitespace. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-identical-to-display-namedescription in node parameter must not be identical to displayName.๐Ÿ”ต
node-param-description-line-break-html-tagdescription in node parameter must not contain an HTML line break. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-lowercase-first-charFirst char in description in node parameter must be uppercase. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-miscased-idID in description in node parameter must be fully uppercased. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-missing-final-perioddescription in node parameter must end with a final period if a multiple-sentence description, unless ending with </code>. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-missing-for-return-alldescription for Return All node parameter must be present.๐ŸŸข
node-param-description-missing-for-simplifydescription for Simplify node parameter must be present.๐ŸŸข
node-param-description-missing-from-dynamic-multi-optionsdescription in dynamic-multi-options-type node parameter must be present.๐ŸŸข
node-param-description-missing-from-dynamic-optionsdescription in dynamic-options-type node parameter must be present.๐ŸŸข
node-param-description-missing-from-limitdescription in Limit node parameter must be present.๐ŸŸข
node-param-description-unencoded-angle-bracketsdescription in node parameter must encode angle brackets for them to render. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-unneeded-backticksdescription in node parameter must not use unneeded backticks. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-untrimmeddescription in node parameter must be trimmed. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-url-missing-protocoldescription in node parameter must include protocol when containing a URL. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-weakdescription in node parameter must be either useful or omitted. Applicable by extension to description in option in options-type and multi-options-type node parameter.๐ŸŸข
node-param-description-wrong-for-dynamic-multi-optionsdescription in dynamic-multi-options-type node parameter must be Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>๐ŸŸข
node-param-description-wrong-for-dynamic-optionsdescription in dynamic-options-type node parameter must be Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>๐ŸŸข
node-param-description-wrong-for-limitdescription for Limit node parameter must be Max number of results to return๐ŸŸข
node-param-description-wrong-for-return-alldescription for Return All node parameter must be Whether to return all results or only up to a given limit๐ŸŸข
node-param-description-wrong-for-simplifydescription for Simplify node parameter must be Whether to return a simplified version of the response instead of the raw data๐ŸŸข
node-param-description-wrong-for-upsertdescription for Upsert node parameter must be Create a new record, or update the current one if it already exists (upsert)๐ŸŸข
node-param-display-name-excess-inner-whitespacedisplayName in node parameter or in fixed collection section must not contain excess inner whitespace. Applicable by extension to name in options-type or multi-options-type node parameter.๐ŸŸข
node-param-display-name-lowercase-first-charFirst char in displayName in node parameter or in fixed collection section must be uppercase. Applicable by extension to name in options-type or multi-options-type node parameter.๐ŸŸข
node-param-display-name-miscased-idID in displayName in node parameter must be fully uppercased. Applicable by extension to name in options-type or multi-options-type node parameter.๐ŸŸข
node-param-display-name-miscaseddisplayName in node parameter or in fixed collection section must title cased. Applicable by extension to name in options-type or multi-options-type node parameter.๐ŸŸข
node-param-display-name-nonstandard-for-fixed-collectiondisplayName for top-level fixed collection for create operation must be Additional Fields. displayName for top-level fixed collection for update operation must be Update Fields. displayName for top-level fixed collection for get-all operation must be Options.๐ŸŸข
node-param-display-name-untrimmeddisplayName in node parameter or in fixed collection section must be trimmed. Applicable by extension to name in options-type or multi-options-type node parameter.๐ŸŸข
node-param-display-name-wrong-for-dynamic-multi-optionsdisplayName for dynamic-multi-options-type node parameter must end with Name or ID๐Ÿ”ต
node-param-display-name-wrong-for-dynamic-optionsdisplayName for dynamic-options-type node parameter must end with Name or ID๐Ÿ”ต
node-param-display-name-wrong-for-simplifydisplayName for Simplify node parameter must be Simplify๐ŸŸข
node-param-display-name-wrong-for-update-fieldsdisplayName for Update operation node parameter must be Update Fields๐ŸŸข
node-param-fixed-collection-type-unsorted-itemsItems in a fixed-collection-type node parameter must be alphabetized by displayName if more than five.๐ŸŸข
node-param-min-value-wrong-for-limitminValue for Limit node parameter must be a positive integer.๐ŸŸข
node-param-multi-options-type-unsorted-itemsItems in a multi-options-type node parameter must be alphabetized by name if more than five.๐ŸŸข
node-param-operation-without-no-data-expressionnoDataExpression in an Operation node parameter must be present and enabled.๐ŸŸข
node-param-option-description-identical-to-namedescription in option in options-type node parameter must not be identical to name.๐Ÿ”ต
node-param-option-name-containing-starOption name in options-type node parameter must not contain *. Use [All] instead.๐ŸŸข
node-param-option-name-duplicateOption name in options-type node parameter must not be a duplicate.๐ŸŸข
node-param-option-name-wrong-for-get-allOption name for Get All node parameter must be Get All๐ŸŸข
node-param-option-name-wrong-for-upsertOption name for Upsert node parameter must be Upsert.๐ŸŸข
node-param-option-value-duplicateOption value in options-type node parameter must not be a duplicate.๐ŸŸข
node-param-options-type-unsorted-itemsItems in options-type node parameter must be alphabetized by name if more than five.๐ŸŸข
node-param-required-falserequired: false in node parameter must be removed becaused it is implied.๐ŸŸข
node-param-resource-with-plural-optionOption name for a Resource node parameter must be singular.๐ŸŸข
node-param-resource-without-no-data-expressionnoDataExpression in a Resource node parameter must be present and enabled.๐ŸŸข
node-param-type-options-missing-from-limittypeOptions in Limit node parameter must be present.๐ŸŸข

Author

ยฉ 2022 Ivรกn Ovejero

License

Distributed under the MIT License.

FAQs

Package last updated on 07 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc