In the execute()
method there is no need to double assert the type of items.length
.
📋 This rule is part of the plugin:n8n-nodes-base/nodes
config.
🔧 Run ESLint with --fix
option to autofix the issue flagged by this rule.
❌ Example of incorrect code:
class TestNode {
async execute() {
const items = this.getInputData();
const length = items.length as unknown as number;
}
}
class TestNode {
async execute() {
const items = this.getInputData();
const length = (items.length as unknown) as number;
}
}
✅ Example of correct code:
class TestNode {
async execute() {
const items = this.getInputData();
const length = items.length;
}
}