From 2eb1069e6dcfc5116e98cf93e2076be5e0cfab19 Mon Sep 17 00:00:00 2001 From: agobrech Date: Fri, 1 Jul 2022 15:29:03 +0200 Subject: [PATCH 1/4] Rule working as intended, add exception to existing nodes --- .eslintrc.js | 1 + packages/nodes-base/nodes/Asana/Asana.node.ts | 3 ++- packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts | 1 + packages/nodes-base/nodes/Google/Calendar/EventDescription.ts | 3 ++- packages/nodes-base/nodes/Google/YouTube/ChannelDescription.ts | 1 + packages/nodes-base/nodes/Notion/Blocks.ts | 1 + .../nodes-base/nodes/Onfleet/descriptions/WorkerDescription.ts | 1 + packages/nodes-base/nodes/Trello/LabelDescription.ts | 3 ++- packages/nodes-base/nodes/Twist/ChannelDescription.ts | 3 ++- packages/nodes-base/nodes/Wekan/BoardDescription.ts | 1 + packages/nodes-base/nodes/Wekan/CardDescription.ts | 1 + 11 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 567909601e23e..e738993bcfa1a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -461,6 +461,7 @@ module.exports = { 'n8n-nodes-base/node-dirname-against-convention': 'error', 'n8n-nodes-base/node-class-description-name-unsuffixed-trigger-node': 'error', 'n8n-nodes-base/node-class-description-display-name-unsuffixed-trigger-node': 'error', + 'n8n-nodes-base/node-param-color-type-unused': 'error', }, }, ], diff --git a/packages/nodes-base/nodes/Asana/Asana.node.ts b/packages/nodes-base/nodes/Asana/Asana.node.ts index e567669ea4b63..abd8a3944d5fe 100644 --- a/packages/nodes-base/nodes/Asana/Asana.node.ts +++ b/packages/nodes-base/nodes/Asana/Asana.node.ts @@ -1605,6 +1605,7 @@ export class Asana implements INodeType { { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: getColorOptions(), default: 'none', @@ -1837,7 +1838,7 @@ export class Asana implements INodeType { { displayName: 'Color', name: 'color', - type: 'options', + type: 'color', options: getColorOptions(), default: 'none', description: 'Color of the project', diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 3ccef56ba18c8..8c346a8f5f208 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -210,6 +210,7 @@ export function getTextBlockProperties(): INodeProperties[] { { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', displayOptions: { show: { diff --git a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts index 855a6d937558a..d1b476da28cb2 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts @@ -172,6 +172,7 @@ export const eventFields: INodeProperties[] = [ { displayName: 'Color Name or ID', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', typeOptions: { loadOptionsMethod: 'getColors', @@ -808,7 +809,7 @@ export const eventFields: INodeProperties[] = [ { displayName: 'Color Name or ID', name: 'color', - type: 'options', + type: 'color', typeOptions: { loadOptionsMethod: 'getColors', }, diff --git a/packages/nodes-base/nodes/Google/YouTube/ChannelDescription.ts b/packages/nodes-base/nodes/Google/YouTube/ChannelDescription.ts index b7092e40d07f5..cc4ff6ddcf4f5 100644 --- a/packages/nodes-base/nodes/Google/YouTube/ChannelDescription.ts +++ b/packages/nodes-base/nodes/Google/YouTube/ChannelDescription.ts @@ -438,6 +438,7 @@ export const channelFields: INodeProperties[] = [ { displayName: 'Profile Color', name: 'profileColor', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'string', default: '', description: 'A prominent color that complements the channel\'s content', diff --git a/packages/nodes-base/nodes/Notion/Blocks.ts b/packages/nodes-base/nodes/Notion/Blocks.ts index 41ee5fdf608d1..fffc686e5de6b 100644 --- a/packages/nodes-base/nodes/Notion/Blocks.ts +++ b/packages/nodes-base/nodes/Notion/Blocks.ts @@ -128,6 +128,7 @@ const annotation: INodeProperties[] = [ { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: colors, default: '', diff --git a/packages/nodes-base/nodes/Onfleet/descriptions/WorkerDescription.ts b/packages/nodes-base/nodes/Onfleet/descriptions/WorkerDescription.ts index acd2582bd4540..38bf1ecd44207 100644 --- a/packages/nodes-base/nodes/Onfleet/descriptions/WorkerDescription.ts +++ b/packages/nodes-base/nodes/Onfleet/descriptions/WorkerDescription.ts @@ -139,6 +139,7 @@ const vehicleLicensePlateField = { const vehicleColorField = { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'string', default: '', description: 'The vehicle\'s color', diff --git a/packages/nodes-base/nodes/Trello/LabelDescription.ts b/packages/nodes-base/nodes/Trello/LabelDescription.ts index 42bf45512b11d..44078acf52d62 100644 --- a/packages/nodes-base/nodes/Trello/LabelDescription.ts +++ b/packages/nodes-base/nodes/Trello/LabelDescription.ts @@ -104,6 +104,7 @@ export const labelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', required: true, displayOptions: { @@ -413,7 +414,7 @@ export const labelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - type: 'options', + type: 'color', options: [ { name: 'Black', diff --git a/packages/nodes-base/nodes/Twist/ChannelDescription.ts b/packages/nodes-base/nodes/Twist/ChannelDescription.ts index 138ee29147e71..5e1eb6806a26c 100644 --- a/packages/nodes-base/nodes/Twist/ChannelDescription.ts +++ b/packages/nodes-base/nodes/Twist/ChannelDescription.ts @@ -119,6 +119,7 @@ export const channelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ { @@ -369,7 +370,7 @@ export const channelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - type: 'options', + type: 'color', options: [ { name: 'Berry Red', diff --git a/packages/nodes-base/nodes/Wekan/BoardDescription.ts b/packages/nodes-base/nodes/Wekan/BoardDescription.ts index 4fe604209331a..f8bc6a5046505 100644 --- a/packages/nodes-base/nodes/Wekan/BoardDescription.ts +++ b/packages/nodes-base/nodes/Wekan/BoardDescription.ts @@ -123,6 +123,7 @@ export const boardFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ { diff --git a/packages/nodes-base/nodes/Wekan/CardDescription.ts b/packages/nodes-base/nodes/Wekan/CardDescription.ts index e26838d7c099d..a43ddec8ba2ce 100644 --- a/packages/nodes-base/nodes/Wekan/CardDescription.ts +++ b/packages/nodes-base/nodes/Wekan/CardDescription.ts @@ -609,6 +609,7 @@ export const cardFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', + // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ { From 17c1d6c3083d9734dfca262be70f97de10ea208c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 1 Jul 2022 16:20:18 +0200 Subject: [PATCH 2/4] :arrow_up: Upgrade to plugin version 1.2.28 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index ac761f55e2670..090139162a09d 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -716,7 +716,7 @@ "@types/tmp": "^0.2.0", "@types/uuid": "^8.3.2", "@types/xml2js": "^0.4.3", - "eslint-plugin-n8n-nodes-base": "^1.2.7", + "eslint-plugin-n8n-nodes-base": "^1.2.8", "gulp": "^4.0.0", "jest": "^27.4.7", "n8n-workflow": "~0.106.0", From dea7ef9042e88f321ea51d698a58e4be2161189d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 1 Jul 2022 16:20:27 +0200 Subject: [PATCH 3/4] :package: Update `package-lock.json` --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3302a685be6c4..4eb50d668452b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27497,9 +27497,9 @@ "license": "MIT" }, "node_modules/eslint-plugin-n8n-nodes-base": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/eslint-plugin-n8n-nodes-base/-/eslint-plugin-n8n-nodes-base-1.2.7.tgz", - "integrity": "sha512-KCEVp7Y3Tp38JVu+4+cnxuulRM61gTkbTk8DU+3zLx42yj4wWUBfigPFs12jqqtygJwKglLwK3+HIk4SLkMVdQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-n8n-nodes-base/-/eslint-plugin-n8n-nodes-base-1.2.8.tgz", + "integrity": "sha512-c5EzgtN2jEHvmP35B+vwjMChdjEVv15F/xtWhcgKfDVtVBmGCKvSABtrDOddMA6qCajcdA0Ol/6JifQ1hpnMTg==", "dependencies": { "@typescript-eslint/utils": "^5.17.0", "camel-case": "^4.1.2", @@ -74570,9 +74570,9 @@ } }, "eslint-plugin-n8n-nodes-base": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/eslint-plugin-n8n-nodes-base/-/eslint-plugin-n8n-nodes-base-1.2.7.tgz", - "integrity": "sha512-KCEVp7Y3Tp38JVu+4+cnxuulRM61gTkbTk8DU+3zLx42yj4wWUBfigPFs12jqqtygJwKglLwK3+HIk4SLkMVdQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-n8n-nodes-base/-/eslint-plugin-n8n-nodes-base-1.2.8.tgz", + "integrity": "sha512-c5EzgtN2jEHvmP35B+vwjMChdjEVv15F/xtWhcgKfDVtVBmGCKvSABtrDOddMA6qCajcdA0Ol/6JifQ1hpnMTg==", "requires": { "@typescript-eslint/utils": "^5.17.0", "camel-case": "^4.1.2", From 123d9b3a29a222f851940be6aa16ca2587ab0d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 1 Jul 2022 16:20:49 +0200 Subject: [PATCH 4/4] :shirt: Update lintings with 1.2.8 change --- packages/nodes-base/nodes/Asana/Asana.node.ts | 3 +-- packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts | 1 - packages/nodes-base/nodes/Google/Calendar/EventDescription.ts | 3 +-- packages/nodes-base/nodes/Notion/Blocks.ts | 1 - packages/nodes-base/nodes/Trello/LabelDescription.ts | 3 +-- packages/nodes-base/nodes/Twist/ChannelDescription.ts | 3 +-- packages/nodes-base/nodes/Wekan/BoardDescription.ts | 1 - packages/nodes-base/nodes/Wekan/CardDescription.ts | 1 - 8 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/nodes-base/nodes/Asana/Asana.node.ts b/packages/nodes-base/nodes/Asana/Asana.node.ts index abd8a3944d5fe..e567669ea4b63 100644 --- a/packages/nodes-base/nodes/Asana/Asana.node.ts +++ b/packages/nodes-base/nodes/Asana/Asana.node.ts @@ -1605,7 +1605,6 @@ export class Asana implements INodeType { { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: getColorOptions(), default: 'none', @@ -1838,7 +1837,7 @@ export class Asana implements INodeType { { displayName: 'Color', name: 'color', - type: 'color', + type: 'options', options: getColorOptions(), default: 'none', description: 'Color of the project', diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 8c346a8f5f208..3ccef56ba18c8 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -210,7 +210,6 @@ export function getTextBlockProperties(): INodeProperties[] { { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', displayOptions: { show: { diff --git a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts index d1b476da28cb2..855a6d937558a 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts @@ -172,7 +172,6 @@ export const eventFields: INodeProperties[] = [ { displayName: 'Color Name or ID', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', typeOptions: { loadOptionsMethod: 'getColors', @@ -809,7 +808,7 @@ export const eventFields: INodeProperties[] = [ { displayName: 'Color Name or ID', name: 'color', - type: 'color', + type: 'options', typeOptions: { loadOptionsMethod: 'getColors', }, diff --git a/packages/nodes-base/nodes/Notion/Blocks.ts b/packages/nodes-base/nodes/Notion/Blocks.ts index fffc686e5de6b..41ee5fdf608d1 100644 --- a/packages/nodes-base/nodes/Notion/Blocks.ts +++ b/packages/nodes-base/nodes/Notion/Blocks.ts @@ -128,7 +128,6 @@ const annotation: INodeProperties[] = [ { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: colors, default: '', diff --git a/packages/nodes-base/nodes/Trello/LabelDescription.ts b/packages/nodes-base/nodes/Trello/LabelDescription.ts index 44078acf52d62..42bf45512b11d 100644 --- a/packages/nodes-base/nodes/Trello/LabelDescription.ts +++ b/packages/nodes-base/nodes/Trello/LabelDescription.ts @@ -104,7 +104,6 @@ export const labelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', required: true, displayOptions: { @@ -414,7 +413,7 @@ export const labelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - type: 'color', + type: 'options', options: [ { name: 'Black', diff --git a/packages/nodes-base/nodes/Twist/ChannelDescription.ts b/packages/nodes-base/nodes/Twist/ChannelDescription.ts index 5e1eb6806a26c..138ee29147e71 100644 --- a/packages/nodes-base/nodes/Twist/ChannelDescription.ts +++ b/packages/nodes-base/nodes/Twist/ChannelDescription.ts @@ -119,7 +119,6 @@ export const channelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ { @@ -370,7 +369,7 @@ export const channelFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - type: 'color', + type: 'options', options: [ { name: 'Berry Red', diff --git a/packages/nodes-base/nodes/Wekan/BoardDescription.ts b/packages/nodes-base/nodes/Wekan/BoardDescription.ts index f8bc6a5046505..4fe604209331a 100644 --- a/packages/nodes-base/nodes/Wekan/BoardDescription.ts +++ b/packages/nodes-base/nodes/Wekan/BoardDescription.ts @@ -123,7 +123,6 @@ export const boardFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ { diff --git a/packages/nodes-base/nodes/Wekan/CardDescription.ts b/packages/nodes-base/nodes/Wekan/CardDescription.ts index a43ddec8ba2ce..e26838d7c099d 100644 --- a/packages/nodes-base/nodes/Wekan/CardDescription.ts +++ b/packages/nodes-base/nodes/Wekan/CardDescription.ts @@ -609,7 +609,6 @@ export const cardFields: INodeProperties[] = [ { displayName: 'Color', name: 'color', - // eslint-disable-next-line n8n-nodes-base/node-param-color-type-unused type: 'options', options: [ {