In a credential class, the field properties
must be typed INodeProperties
and individual properties must have no assertions.
📋 This rule is part of the plugin:n8n-nodes-base/credentials
config.
🔧 Run ESLint with --fix
option to autofix the issue flagged by this rule.
❌ Example of incorrect code:
class TestApi implements ICredentialType {
name = 'myTestApi';
displayName = 'My Test API';
documentationUrl = 'myTest';
properties = [
{
displayName: 'API Root URL',
name: 'URL',
type: 'string' as NodePropertyTypes,
default: 'https://kf.kobotoolbox.org/',
},
];
}
class TestApi implements ICredentialType {
name = 'myTestApi';
displayName = 'My Test API';
documentationUrl = 'myTest';
properties: INodeProperties[] = [
{
displayName: 'API Root URL',
name: 'URL',
type: 'string' as NodePropertyTypes,
default: 'https://kf.kobotoolbox.org/',
},
];
}
✅ Example of correct code:
class TestApi implements ICredentialType {
name = 'myTestApi';
displayName = 'My Test API';
documentationUrl = 'myTest';
properties: INodeProperties[] = [
{
displayName: 'API Root URL',
name: 'URL',
type: 'string',
default: 'https://kf.kobotoolbox.org/',
},
];
}