From d0c9120031671a6708b7254794a061e8fdfc0b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 9 Sep 2022 10:35:50 +0200 Subject: [PATCH] refactor(nodes-base): Apply lint rule `cred-class-field-authenticate-type-assertion` (#4057) :shirt: Apply `cred-class-field-authenticate-type-assertion` --- .eslintrc.js | 1 + packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts | 4 ++-- packages/nodes-base/credentials/UrlScanIoApi.credentials.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f0f022816daaf..7a367860fa584 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -376,6 +376,7 @@ module.exports = { files: ['./packages/nodes-base/credentials/*.credentials.ts'], plugins: ['eslint-plugin-n8n-nodes-base'], rules: { + 'n8n-nodes-base/cred-class-field-authenticate-type-assertion': 'error', 'n8n-nodes-base/cred-class-field-display-name-missing-oauth2': 'error', 'n8n-nodes-base/cred-class-field-name-missing-oauth2': 'error', 'n8n-nodes-base/cred-class-field-name-unsuffixed': 'error', diff --git a/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts b/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts index 145989a429de8..38e54c4f91377 100644 --- a/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts +++ b/packages/nodes-base/credentials/KoBoToolboxApi.credentials.ts @@ -25,14 +25,14 @@ export class KoBoToolboxApi implements ICredentialType { hint: 'You can get your API token at https://[api-root]/token/?format=json (for a logged in user)', }, ]; - authenticate = { + authenticate: IAuthenticateGeneric = { type: 'generic', properties: { headers: { Authorization: '=Token {{$credentials.token}}', }, }, - } as IAuthenticateGeneric; + }; test: ICredentialTestRequest = { request: { diff --git a/packages/nodes-base/credentials/UrlScanIoApi.credentials.ts b/packages/nodes-base/credentials/UrlScanIoApi.credentials.ts index b4076faf9897e..0ca8eb53f0055 100644 --- a/packages/nodes-base/credentials/UrlScanIoApi.credentials.ts +++ b/packages/nodes-base/credentials/UrlScanIoApi.credentials.ts @@ -25,7 +25,7 @@ export class UrlScanIoApi implements ICredentialType { 'API-KEY': '={{$credentials.apiKey}}', }, }, - } as IAuthenticateGeneric; + }; test: ICredentialTestRequest = { request: {