Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
nodelinter
Advanced tools
Static code analyzer for n8n node files
by Iván Ovejero
Nodelinter is a static code analyzer for n8n node files, with ~70 linting rules for:
See full lintings list.
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
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
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.
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.',
© 2021 Iván Ovejero
Distributed under the MIT License.
FAQs
Linter for n8n nodes
We found that nodelinter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.