Skip to content

Commit

Permalink
Merge pull request #3629 from n8n-io/n8n-3995
Browse files Browse the repository at this point in the history
Apply `node-param-array-type-assertion`
  • Loading branch information
agobrech authored Jul 1, 2022
2 parents 5abc48f + 1fe4294 commit 53f4716
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ module.exports = {
'n8n-nodes-base/node-param-resource-without-no-data-expression': 'error',
'n8n-nodes-base/node-param-type-options-missing-from-limit': 'error',
'n8n-nodes-base/node-param-description-missing-from-dynamic-multi-options': 'error',
'n8n-nodes-base/node-param-array-type-assertion': 'error',
'n8n-nodes-base/node-dirname-against-convention': 'error',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from 'n8n-workflow';

export const createEmployeeSharedDescription = (sync = false): INodeProperties[] => {
let elements = [
let elements: INodeProperties[] = [
{
displayName: 'Address',
name: 'address',
Expand Down Expand Up @@ -290,7 +290,7 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[]
placeholder: '123-45-6789',
description: 'A standard United States Social Security number, with dashes',
},
] as INodeProperties[];
];

if (sync === true) {
elements = elements.map(element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from 'n8n-workflow';

export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] => {
let elements = [
let elements: INodeProperties[] = [
{
displayName: 'Address',
name: 'addasasress',
Expand Down Expand Up @@ -316,7 +316,7 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[]
placeholder: '123-45-6789',
description: 'A standard United States Social Security number, with dashes',
},
] as INodeProperties[];
];

if (sync === true) {
elements = elements.map(element => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Notion/BlockDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
blocks,
} from './Blocks';

export const blockOperations = [
export const blockOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
Expand Down Expand Up @@ -34,7 +34,7 @@ export const blockOperations = [
],
default: 'append',
},
] as INodeProperties[];
];

export const blockFields = [

Expand Down
8 changes: 4 additions & 4 deletions packages/nodes-base/nodes/Notion/DatabaseDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
INodeProperties,
} from 'n8n-workflow';

export const databaseOperations = [
export const databaseOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
Expand Down Expand Up @@ -66,9 +66,9 @@ export const databaseOperations = [
],
default: 'get',
},
] as INodeProperties[];
];

export const databaseFields = [
export const databaseFields: INodeProperties[] = [

/* -------------------------------------------------------------------------- */
/* database:get */
Expand Down Expand Up @@ -301,4 +301,4 @@ export const databaseFields = [
},
],
},
] as INodeProperties[];
];
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Notion/DatabasePageDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
filters,
} from './Filters';

export const databasePageOperations = [
export const databasePageOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
Expand Down Expand Up @@ -90,7 +90,7 @@ export const databasePageOperations = [
],
default: 'create',
},
] as INodeProperties[];
];

export const databasePageFields = [

Expand Down
4 changes: 2 additions & 2 deletions packages/nodes-base/nodes/Notion/PageDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
blocks,
} from './Blocks';

export const pageOperations = [
export const pageOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
Expand Down Expand Up @@ -75,7 +75,7 @@ export const pageOperations = [
],
default: 'create',
},
] as INodeProperties[];
];

export const pageFields = [

Expand Down
8 changes: 4 additions & 4 deletions packages/nodes-base/nodes/Notion/UserDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
INodeProperties,
} from 'n8n-workflow';

export const userOperations = [
export const userOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
Expand All @@ -29,9 +29,9 @@ export const userOperations = [
],
default: 'get',
},
] as INodeProperties[];
];

export const userFields = [
export const userFields: INodeProperties[] = [

/* -------------------------------------------------------------------------- */
/* user:get */
Expand Down Expand Up @@ -97,4 +97,4 @@ export const userFields = [
default: 50,
description: 'Max number of results to return',
},
] as INodeProperties[];
];

0 comments on commit 53f4716

Please sign in to comment.