npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodelinter

v0.1.19

Published

Linter for n8n nodes

Downloads

635

Readme

Nodelinter is a static code analyzer for n8n node files, with ~70 linting rules for:

  • default values based on param type,
  • casing for display names and descriptions,
  • alphabetization for params and options,
  • required and optional key-value pairs,
  • expected values for specific params,
  • etc.

See full lintings list.

Operation

Run via npx:

npx nodelinter --target=/Users/john/n8n/packages/nodes-base/nodes/Stripe/Stripe.node.ts

Or run locally:

git clone https://github.com/n8n-io/nodelinter
cd nodelinter; npm i
npm run lint -- --target=/Users/john/n8n/packages/nodes-base/nodes/Stripe/Stripe.node.ts

Options

| Option | Effect | | ----------------- | -------------------------------------------------- | | --target | Path of the file or directory to lint | | --config | Path of the custom config to use | | --print | Whether to print output to lintOutput.json | | --patterns | Lintable file patterns | | --errors-only | Enable error logs only | | --warnings-only | Enable warning logs only | | --infos-only | Enable info logs only |

Examples:

# lint a single file
--target=./packages/nodes-base/nodes/Stripe/Stripe.node.ts

# lint all files in a dir
--target=./packages/nodes-base/nodes/Stripe

# use a custom config
--config=/Users/john/Documents/myConfig.json

# print logs to lintOutput.json
--print

# lint files ending with these patterns
--target=./src/input/MyNode --patterns:.node.ts,Description.ts

# lint files ending with this pattern
--target=./src/input/MyNode --patterns:.node.ts

# lint only rules with error classification
--target=./src/input/MyNode --errors-only

Custom config

You can override the Nodelinter default config with a custom config.

To do so, create a JSON file containing any keys to overwrite:

{
  "target": "/Users/john/n8n/packages/nodes-base/nodes/Notion/Notion.node.ts",
  "patterns": [".node.ts"],
  "sortMethod": "lineNumber",
  "lintings": {
    "PARAM_DESCRIPTION_MISSING_WHERE_OPTIONAL": {
      "enabled": false
    },
    "NAME_WITH_NO_CAMELCASE": {
      "enabled": false
    }
  }
}

And use the --config option:

npx nodelinter --config=/Users/john/Documents/myConfig.json

For convenience, when running locally, if you place a custom config file named nodelinter.config.json anywhere inside the nodelinter dir, the custom config file will be auto-detected.

Lint exceptions

Add // nodelinter-ignore-next-line LINTING_NAME to except the next line from one or more specific lintings:

// nodelinter-ignore-next-line PARAM_DESCRIPTION_WITH_EXCESS_WHITESPACE
description: 'Time zone used in the response.    The default is the time zone of the calendar.',

// nodelinter-ignore-next-line PARAM_DESCRIPTION_WITH_EXCESS_WHITESPACE PARAM_DESCRIPTION_UNTRIMMED
description: 'Time zone used in the response.    The default is the time zone of the calendar.   ',

Or add // nodelinter-ignore-next-line to except the next line from all lintings:

// nodelinter-ignore-next-line
description: 'Time zone used in the response.    The default is the time zone of the calendar.',

Author

© 2021 Iván Ovejero

License

Distributed under the MIT License.