diff --git a/packages/@n8n/eslint-config/src/configs/base.ts b/packages/@n8n/eslint-config/src/configs/base.ts index 70dd395e2a..aa8084de57 100644 --- a/packages/@n8n/eslint-config/src/configs/base.ts +++ b/packages/@n8n/eslint-config/src/configs/base.ts @@ -11,13 +11,6 @@ import tseslint from 'typescript-eslint'; import eslintConfigPrettier from 'eslint-config-prettier/flat'; import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'; -// Slowest rules are disabled locally (for lint, not lintfix) to improve performance in development -// They are enabled in CI to ensure code quality -const runAllRules = - process.env.CI === 'true' || - process.env.INCLUDE_SLOW_RULES === 'true' || - process.argv.includes('--fix'); - export const baseConfig = tseslint.config( globalIgnores([ 'node_modules/**', @@ -110,7 +103,7 @@ export const baseConfig = tseslint.config( '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], /** https://typescript-eslint.io/rules/await-thenable/ */ - '@typescript-eslint/await-thenable': runAllRules ? 'error' : 'off', + '@typescript-eslint/await-thenable': 'error', /** * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -230,16 +223,12 @@ export const baseConfig = tseslint.config( /** * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md */ - '@typescript-eslint/no-misused-promises': runAllRules - ? ['error', { checksVoidReturn: false }] - : 'off', + '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }], /** * https://github.com/typescript-eslint/typescript-eslint/blob/v4.30.0/packages/eslint-plugin/docs/rules/no-floating-promises.md */ - '@typescript-eslint/no-floating-promises': runAllRules - ? ['error', { ignoreVoid: true }] - : 'off', + '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }], /** * https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-namespace.md @@ -259,7 +248,7 @@ export const baseConfig = tseslint.config( /** * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md */ - '@typescript-eslint/no-unnecessary-qualifier': runAllRules ? 'error' : 'off', + '@typescript-eslint/no-unnecessary-qualifier': 'error', /** * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -279,7 +268,7 @@ export const baseConfig = tseslint.config( /** * https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md */ - '@typescript-eslint/promise-function-async': runAllRules ? 'error' : 'off', + '@typescript-eslint/promise-function-async': 'error', /** * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -303,7 +292,7 @@ export const baseConfig = tseslint.config( /** * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md */ - 'import-x/no-cycle': runAllRules ? ['error', { ignoreExternal: false, maxDepth: 3 }] : 'off', + 'import-x/no-cycle': ['error', { ignoreExternal: false, maxDepth: 3 }], /** * https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-default-export.md diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts index 7fe0f3093f..70e0a32089 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/node-execution-context.test.ts @@ -34,7 +34,7 @@ describe('NodeExecutionContext', () => { timezone: 'UTC', expression, }); - let additionalData = mock({ + const additionalData = mock({ credentialsHelper: mock(), }); diff --git a/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts b/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts index 436d7f983c..37d2f3272d 100644 --- a/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/__tests__/supply-data-context.test.ts @@ -14,8 +14,8 @@ import type { INodeTypes, ICredentialDataDecryptedObject, NodeConnectionType, + IRunData, } from 'n8n-workflow'; -import type { IRunData } from 'n8n-workflow'; import { ApplicationError, NodeConnectionTypes } from 'n8n-workflow'; import { describeCommonTests } from './shared-tests'; diff --git a/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts b/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts index e1ffd8017b..c779c2ca45 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-input-connection-data.test.ts @@ -12,8 +12,8 @@ import type { INodeTypes, IExecuteFunctions, IRunData, + ITaskData, } from 'n8n-workflow'; -import type { ITaskData } from 'n8n-workflow'; import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { ExecuteContext } from '../../execute-context'; diff --git a/packages/core/src/execution-engine/node-execution-context/utils/binary-helper-functions.ts b/packages/core/src/execution-engine/node-execution-context/utils/binary-helper-functions.ts index 9a34622127..5cfc8f78c5 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/binary-helper-functions.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/binary-helper-functions.ts @@ -187,7 +187,7 @@ export async function copyBinaryFile( * Takes a buffer and converts it into the format n8n uses. It encodes the binary data as * base64 and adds metadata. */ -// eslint-disable-next-line complexity + export async function prepareBinaryData( binaryData: Buffer | Readable, executionId: string, diff --git a/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts b/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts index 961efafd0e..cac810c229 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts @@ -5,7 +5,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-shadow */ + import { Logger } from '@n8n/backend-common'; import type { ClientOAuth2Options, @@ -227,11 +227,10 @@ const getBeforeRedirectFn = axiosConfig: AxiosRequestConfig, proxyConfig: IHttpRequestOptions['proxy'] | string | undefined, ) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any (redirectedRequest: Record) => { const redirectAgentOptions = { ...agentOptions, - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + servername: redirectedRequest.hostname, }; const redirectAgent = getAgentWithProxy({ @@ -248,7 +247,6 @@ const getBeforeRedirectFn = } if (axiosConfig.headers?.Authorization) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access redirectedRequest.headers.Authorization = axiosConfig.headers.Authorization; } if (axiosConfig.auth) { @@ -327,11 +325,8 @@ export async function invokeAxios( } } -// eslint-disable-next-line @typescript-eslint/no-explicit-any const pushFormDataValue = (form: FormData, key: string, value: any) => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access if (value?.hasOwnProperty('value') && value.hasOwnProperty('options')) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument form.append(key, value.value, value.options); } else { form.append(key, value); @@ -361,7 +356,6 @@ async function generateContentLengthHeader(config: AxiosRequestConfig) { } try { const length = await new Promise((res, rej) => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access config.data.getLength((error: Error | null, dataLength: number) => { if (error) rej(error); else res(dataLength); @@ -372,7 +366,6 @@ async function generateContentLengthHeader(config: AxiosRequestConfig) { 'content-length': length, }; } catch (error) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment Container.get(Logger).error('Unable to calculate form data length', { error }); } } @@ -416,7 +409,6 @@ export async function parseRequestObject(requestObject: IRequestOptions) { if (typeof requestObject.body === 'string') { axiosConfig.data = requestObject.body; } else { - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const allData = Object.assign(requestObject.body || {}, requestObject.form || {}) as Record< string, string @@ -441,9 +433,9 @@ export async function parseRequestObject(requestObject: IRequestOptions) { // replace the existing header with a new one that // contains the boundary property. delete axiosConfig.headers?.[contentTypeHeaderKeyName!]; - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access + const headers = axiosConfig.data.getHeaders(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/prefer-nullish-coalescing + axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers); await generateContentLengthHeader(axiosConfig); } else { @@ -482,16 +474,16 @@ export async function parseRequestObject(requestObject: IRequestOptions) { axiosConfig.data = createFormDataObject(requestObject.formData as Record); } // Mix in headers as FormData creates the boundary. - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + const headers = axiosConfig.data.getHeaders(); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/prefer-nullish-coalescing + axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers); await generateContentLengthHeader(axiosConfig); } else if (requestObject.body !== undefined) { // If we have body and possibly form if (requestObject.form !== undefined && requestObject.body) { // merge both objects when exist. - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + requestObject.body = Object.assign(requestObject.body, requestObject.form); } axiosConfig.data = requestObject.body as FormData | GenericValue | GenericValue[]; @@ -559,7 +551,6 @@ export async function parseRequestObject(requestObject: IRequestOptions) { if (requestObject.auth !== undefined) { // Check support for sendImmediately if (requestObject.auth.bearer !== undefined) { - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing axiosConfig.headers = Object.assign(axiosConfig.headers || {}, { Authorization: `Bearer ${requestObject.auth.bearer}`, }); @@ -567,9 +558,8 @@ export async function parseRequestObject(requestObject: IRequestOptions) { const authObj = requestObject.auth; // Request accepts both user/username and pass/password axiosConfig.auth = { - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing username: (authObj.user || authObj.username) as string, - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + password: (authObj.password || authObj.pass) as string, }; } @@ -586,7 +576,6 @@ export async function parseRequestObject(requestObject: IRequestOptions) { .map((headerKey) => headerKey.toLowerCase()) .includes('accept'); if (!acceptHeaderExists) { - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing axiosConfig.headers = Object.assign(axiosConfig.headers || {}, { Accept: 'application/json', }); @@ -594,7 +583,7 @@ export async function parseRequestObject(requestObject: IRequestOptions) { } if (requestObject.json === false || requestObject.json === undefined) { // Prevent json parsing - // eslint-disable-next-line @typescript-eslint/no-unsafe-return + axiosConfig.transformResponse = (res) => res; } @@ -647,7 +636,6 @@ export async function parseRequestObject(requestObject: IRequestOptions) { // as the service returns XML unless requested otherwise. const allHeaders = axiosConfig.headers ? Object.keys(axiosConfig.headers) : []; if (!allHeaders.some((headerKey) => headerKey.toLowerCase() === 'accept')) { - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing axiosConfig.headers = Object.assign(axiosConfig.headers || {}, { accept: '*/*' }); } if ( @@ -661,7 +649,7 @@ export async function parseRequestObject(requestObject: IRequestOptions) { // If we don't specify this here, axios will add // application/json; charset=utf-8 // and this breaks a lot of stuff - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + axiosConfig.headers = Object.assign(axiosConfig.headers || {}, { 'content-type': 'application/json', }); @@ -771,7 +759,6 @@ export async function proxyRequestToAxios( } } -// eslint-disable-next-line complexity export function convertN8nRequestToAxios(n8nRequest: IHttpRequestOptions): AxiosRequestConfig { // Destructure properties with the same name first. const { headers, method, timeout, auth, proxy, url } = n8nRequest; diff --git a/packages/core/src/execution-engine/node-execution-context/utils/validate-value-against-schema.ts b/packages/core/src/execution-engine/node-execution-context/utils/validate-value-against-schema.ts index c683f2ddd2..5f0e2a9bba 100644 --- a/packages/core/src/execution-engine/node-execution-context/utils/validate-value-against-schema.ts +++ b/packages/core/src/execution-engine/node-execution-context/utils/validate-value-against-schema.ts @@ -40,7 +40,7 @@ const validateResourceMapperValue = ( for (let i = 0; i < paramValueNames.length; i++) { const key = paramValueNames[i]; const resolvedValue = paramValues[key]; - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call + const schemaEntry = schema.find((s) => s.id === key); if ( diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts index d2d293d103..56b77c25e0 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/get-source-data-groups.test.ts @@ -7,8 +7,8 @@ // 1 means the output has run data // PD denotes that the node has pinned data -import type { IPinData } from 'n8n-workflow'; -import { NodeConnectionTypes, type IRunData } from 'n8n-workflow'; +import type { IPinData, IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData, toITaskData } from './helpers'; import { DirectedGraph } from '../directed-graph'; diff --git a/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts b/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts index f3652feacb..476c5db7c7 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/__tests__/recreate-node-execution-stack.test.ts @@ -15,8 +15,10 @@ import type { ISourceData, IWaitingForExecution, IWaitingForExecutionSource, + IPinData, + IRunData, } from 'n8n-workflow'; -import { NodeConnectionTypes, type IPinData, type IRunData } from 'n8n-workflow'; +import { NodeConnectionTypes } from 'n8n-workflow'; import { createNodeData, toITaskData } from './helpers'; import { DirectedGraph } from '../directed-graph'; diff --git a/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts b/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts index d2302343ca..48477cc32d 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts @@ -124,12 +124,12 @@ export class DirectedGraph { const newConnections: GraphConnection[] = []; for (const incomingConnection of incomingConnections) { - if (options.skipConnectionFn && options.skipConnectionFn(incomingConnection)) { + if (options.skipConnectionFn?.(incomingConnection)) { continue; } for (const outgoingConnection of outgoingConnections) { - if (options.skipConnectionFn && options.skipConnectionFn(outgoingConnection)) { + if (options.skipConnectionFn?.(outgoingConnection)) { continue; } diff --git a/packages/core/src/execution-engine/partial-execution-utils/get-source-data-groups.ts b/packages/core/src/execution-engine/partial-execution-utils/get-source-data-groups.ts index 64bd685dfe..d1b9003eff 100644 --- a/packages/core/src/execution-engine/partial-execution-utils/get-source-data-groups.ts +++ b/packages/core/src/execution-engine/partial-execution-utils/get-source-data-groups.ts @@ -123,7 +123,6 @@ export function getSourceDataGroups( currentInputIndex++; const connectionWithDataIndex = sortedConnectionsWithData.findIndex( - // eslint-disable-next-line @typescript-eslint/no-loop-func (c) => c.inputIndex === currentInputIndex, ); @@ -137,7 +136,6 @@ export function getSourceDataGroups( } const connectionWithoutDataIndex = sortedConnectionsWithoutData.findIndex( - // eslint-disable-next-line @typescript-eslint/no-loop-func (c) => c.inputIndex === currentInputIndex, ); diff --git a/packages/core/src/execution-engine/workflow-execute.ts b/packages/core/src/execution-engine/workflow-execute.ts index 3f304795b9..954e2613fe 100644 --- a/packages/core/src/execution-engine/workflow-execute.ts +++ b/packages/core/src/execution-engine/workflow-execute.ts @@ -1178,7 +1178,6 @@ export class WorkflowExecute { const newInputData: ITaskDataConnections = {}; for (const connectionType of Object.keys(inputData)) { newInputData[connectionType] = inputData[connectionType].map((input) => { - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain return input && input.slice(0, 1); }); } @@ -1558,7 +1557,7 @@ export class WorkflowExecute { if (waitBetweenTries !== 0) { // TODO: Improve that in the future and check if other nodes can // be executed in the meantime - // eslint-disable-next-line @typescript-eslint/no-shadow + await new Promise((resolve) => { setTimeout(() => { resolve(undefined); @@ -1767,14 +1766,11 @@ export class WorkflowExecute { lineResult.json.$error !== undefined && lineResult.json.$json !== undefined ) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment lineResult.error = lineResult.json.$error as NodeApiError | NodeOperationError; lineResult.json = { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment error: (lineResult.json.$error as NodeApiError | NodeOperationError).message, }; } else if (lineResult.error !== undefined) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment lineResult.json = { error: lineResult.error.message }; } } @@ -1986,7 +1982,7 @@ export class WorkflowExecute { const parentNodes = workflow.getParentNodes(nodeName); // Check if input nodes (of same run) got already executed - // eslint-disable-next-line @typescript-eslint/no-loop-func + const parentIsWaiting = parentNodes.some((value) => waitingNodes.includes(value)); if (parentIsWaiting) { // Execute node later as one of its dependencies is still outstanding @@ -2127,12 +2123,11 @@ export class WorkflowExecute { this.moveNodeMetadata(); - await hooks.runHook('workflowExecuteAfter', [fullRunData, newStaticData]).catch( - // eslint-disable-next-line @typescript-eslint/no-shadow - (error) => { + await hooks + .runHook('workflowExecuteAfter', [fullRunData, newStaticData]) + .catch((error) => { console.error('There was a problem running hook "workflowExecuteAfter"', error); - }, - ); + }); if (closeFunction) { try { diff --git a/packages/core/src/nodes-loader/load-class-in-isolation.ts b/packages/core/src/nodes-loader/load-class-in-isolation.ts index 3ff48810dc..3db9f2772c 100644 --- a/packages/core/src/nodes-loader/load-class-in-isolation.ts +++ b/packages/core/src/nodes-loader/load-class-in-isolation.ts @@ -9,7 +9,7 @@ export const loadClassInIsolation = (filePath: string, className: string) => // Note: Skip the isolation because it breaks nock mocks in tests if (inTest) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access return new (require(filePath)[className])() as T; } else { const script = new Script(`new (require('${filePath}').${className})()`); diff --git a/packages/core/src/utils/is-json-compatible.ts b/packages/core/src/utils/is-json-compatible.ts index 8aefc7aaf7..862b075fb8 100644 --- a/packages/core/src/utils/is-json-compatible.ts +++ b/packages/core/src/utils/is-json-compatible.ts @@ -1,4 +1,3 @@ -/* eslint-disable complexity */ const check = ( val: unknown, path = 'value', diff --git a/packages/workflow/src/augment-object.ts b/packages/workflow/src/augment-object.ts index 04fc9bceec..9242aadda2 100644 --- a/packages/workflow/src/augment-object.ts +++ b/packages/workflow/src/augment-object.ts @@ -12,10 +12,8 @@ function augment(value: T): T { if (value instanceof Date) return new Date(value.valueOf()) as T; if (value instanceof Uint8Array) return value.slice() as T; - // eslint-disable-next-line @typescript-eslint/no-use-before-define if (Array.isArray(value)) return augmentArray(value) as T; - // eslint-disable-next-line @typescript-eslint/no-use-before-define return augmentObject(value) as T; } diff --git a/packages/workflow/src/errors/abstract/node.error.ts b/packages/workflow/src/errors/abstract/node.error.ts index ef10313f6f..8d0f936056 100644 --- a/packages/workflow/src/errors/abstract/node.error.ts +++ b/packages/workflow/src/errors/abstract/node.error.ts @@ -94,7 +94,7 @@ export abstract class NodeError extends ExecutionBaseError { if (typeof value === 'number') return value.toString(); if (Array.isArray(value)) { const resolvedErrors: string[] = value - // eslint-disable-next-line @typescript-eslint/no-shadow + .map((jsonError) => { if (typeof jsonError === 'string') return jsonError; if (typeof jsonError === 'number') return jsonError.toString(); diff --git a/packages/workflow/src/errors/expression.error.ts b/packages/workflow/src/errors/expression.error.ts index bf173c2fc4..8b8bb6ef86 100644 --- a/packages/workflow/src/errors/expression.error.ts +++ b/packages/workflow/src/errors/expression.error.ts @@ -1,5 +1,5 @@ -import { ExecutionBaseError } from './abstract/execution-base.error'; import type { IDataObject } from '../interfaces'; +import { ExecutionBaseError } from './abstract/execution-base.error'; export interface ExpressionErrorOptions { cause?: Error; diff --git a/packages/workflow/src/errors/workflow-operation.error.ts b/packages/workflow/src/errors/workflow-operation.error.ts index 2895d10eb7..8c241caa41 100644 --- a/packages/workflow/src/errors/workflow-operation.error.ts +++ b/packages/workflow/src/errors/workflow-operation.error.ts @@ -1,5 +1,5 @@ -import { ExecutionBaseError } from './abstract/execution-base.error'; import type { INode } from '../interfaces'; +import { ExecutionBaseError } from './abstract/execution-base.error'; /** * Class for instantiating an operational error, e.g. a timeout error. diff --git a/packages/workflow/src/expression-sandboxing.ts b/packages/workflow/src/expression-sandboxing.ts index c21156d3fc..e96e28e849 100644 --- a/packages/workflow/src/expression-sandboxing.ts +++ b/packages/workflow/src/expression-sandboxing.ts @@ -14,7 +14,6 @@ export const PrototypeSanitizer: ASTAfterHook = (ast, dataNode) => { if (!node.computed) { // This is static, so we're safe to error here if (node.property.type !== 'Identifier') { - // eslint-disable-next-line n8n-local-rules/no-plain-errors throw new ExpressionError( `Unknown property type ${node.property.type} while sanitising expression`, ); diff --git a/packages/workflow/src/expression.ts b/packages/workflow/src/expression.ts index ada41faeac..1f68d88cb4 100644 --- a/packages/workflow/src/expression.ts +++ b/packages/workflow/src/expression.ts @@ -5,6 +5,7 @@ import { ExpressionExtensionError } from './errors/expression-extension.error'; import { ExpressionError } from './errors/expression.error'; import { evaluateExpression, setErrorHandler } from './expression-evaluator-proxy'; import { sanitizer, sanitizerName } from './expression-sandboxing'; +import { isExpression } from './expressions/expression-helpers'; import { extend, extendOptional } from './extensions'; import { extendSyntax } from './extensions/expression-extension'; import { extendedFunctions } from './extensions/extended-functions'; @@ -25,7 +26,6 @@ import type { } from './interfaces'; import type { Workflow } from './workflow'; import { WorkflowDataProxy } from './workflow-data-proxy'; -import { isExpression } from './expressions/expression-helpers'; const IS_FRONTEND_IN_DEV_MODE = typeof process === 'object' && diff --git a/packages/workflow/src/extensions/expression-extension.ts b/packages/workflow/src/extensions/expression-extension.ts index 8ba3bf2ecf..20fc900c3d 100644 --- a/packages/workflow/src/extensions/expression-extension.ts +++ b/packages/workflow/src/extensions/expression-extension.ts @@ -136,7 +136,6 @@ export const extendTransform = (expression: string): { code: string } | undefine // This is to match behavior in our original expression evaluator (tmpl) const globalIdentifier = types.builders.identifier( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment typeof window !== 'object' ? 'global' : 'window', ); // We want to define all of our commonly used identifiers and member diff --git a/packages/workflow/src/interfaces.ts b/packages/workflow/src/interfaces.ts index abd9ff15ac..45b50fba25 100644 --- a/packages/workflow/src/interfaces.ts +++ b/packages/workflow/src/interfaces.ts @@ -893,7 +893,7 @@ type BaseExecutionFunctions = FunctionsBaseWithRequiredKeys<'getMode'> & { getInputSourceData(inputIndex?: number, connectionType?: NodeConnectionType): ISourceData; getExecutionCancelSignal(): AbortSignal | undefined; onExecutionCancellation(handler: () => unknown): void; - logAiEvent(eventName: AiEvent, msg?: string | undefined): void; + logAiEvent(eventName: AiEvent, msg?: string): void; }; // TODO: Create later own type only for Config-Nodes @@ -1002,7 +1002,7 @@ export type ISupplyDataFunctions = ExecuteFunctions.GetNodeParameterFn & getWorkflowDataProxy(itemIndex: number): IWorkflowDataProxyData; getExecutionCancelSignal(): AbortSignal | undefined; onExecutionCancellation(handler: () => unknown): void; - logAiEvent(eventName: AiEvent, msg?: string | undefined): void; + logAiEvent(eventName: AiEvent, msg?: string): void; cloneWith(replacements: { runIndex: number; inputData: INodeExecutionData[][]; @@ -1551,7 +1551,7 @@ export interface INodePropertyValueExtractorFunction { ( this: IExecuteSingleFunctions, value: string | NodeParameterValue, - ): Promise | (string | NodeParameterValue); + ): Promise | string; } export type INodePropertyValueExtractor = INodePropertyValueExtractorRegex; diff --git a/packages/workflow/src/node-helpers.ts b/packages/workflow/src/node-helpers.ts index 7852a9d8ce..920011028a 100644 --- a/packages/workflow/src/node-helpers.ts +++ b/packages/workflow/src/node-helpers.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ -/* eslint-disable @typescript-eslint/no-use-before-define */ + /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable prefer-spread */ @@ -840,7 +840,6 @@ export function getNodeParameters( itemName ] as INodeParameters[]) { nodePropertyOptions = nodeProperties.options!.find( - // eslint-disable-next-line @typescript-eslint/no-shadow (nodePropertyOptions) => nodePropertyOptions.name === itemName, ) as INodePropertyCollection; @@ -875,7 +874,7 @@ export function getNodeParameters( tempNodeParameters = {}; // Get the options of the current item - // eslint-disable-next-line @typescript-eslint/no-shadow + const nodePropertyOptions = nodeProperties.options!.find( (data) => data.name === itemName, ); diff --git a/packages/workflow/src/node-parameters/filter-parameter.ts b/packages/workflow/src/node-parameters/filter-parameter.ts index 532c9db4f6..75f97ae84c 100644 --- a/packages/workflow/src/node-parameters/filter-parameter.ts +++ b/packages/workflow/src/node-parameters/filter-parameter.ts @@ -60,7 +60,6 @@ const withIndefiniteArticle = (noun: string): string => { return `${article} ${noun}`; }; -// eslint-disable-next-line complexity function parseFilterConditionValues( condition: FilterConditionValue, options: FilterOptionsValue, diff --git a/packages/workflow/src/observable-object.ts b/packages/workflow/src/observable-object.ts index 82c9377426..15f7128dd5 100644 --- a/packages/workflow/src/observable-object.ts +++ b/packages/workflow/src/observable-object.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ -/* eslint-disable @typescript-eslint/no-shadow */ import type { IDataObject, IObservableObject } from './interfaces'; diff --git a/packages/workflow/src/workflow-data-proxy.ts b/packages/workflow/src/workflow-data-proxy.ts index f659334af2..2787281932 100644 --- a/packages/workflow/src/workflow-data-proxy.ts +++ b/packages/workflow/src/workflow-data-proxy.ts @@ -1030,7 +1030,7 @@ export class WorkflowDataProxy { const placeholdersDataInputData = inputData?.[NodeConnectionTypes.AiTool]?.[0]?.[itemIndex].json; - if (Boolean(!placeholdersDataInputData)) { + if (!placeholdersDataInputData) { throw new ExpressionError('No execution data available', { runIndex, itemIndex, diff --git a/packages/workflow/src/workflow.ts b/packages/workflow/src/workflow.ts index f44131b248..2bf6a70197 100644 --- a/packages/workflow/src/workflow.ts +++ b/packages/workflow/src/workflow.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-use-before-define */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-for-in-array */ @@ -534,7 +533,7 @@ export class Workflow { } connectionsByIndex = this.connectionsByDestinationNode[nodeName][NodeConnectionTypes.Main][connectionIndex]; - // eslint-disable-next-line @typescript-eslint/no-loop-func + connectionsByIndex?.forEach((connection) => { if (checkedNodes.includes(connection.node)) { // Node got checked already before @@ -730,7 +729,6 @@ export class Workflow { const toAdd = [...queue]; queue = []; - // eslint-disable-next-line @typescript-eslint/no-loop-func toAdd.forEach((curr) => { if (visited[curr.name]) { visited[curr.name].indicies = dedupe(visited[curr.name].indicies.concat(curr.indicies)); @@ -770,7 +768,7 @@ export class Workflow { const outputs = NodeHelpers.getNodeOutputs(this, node, nodeType.description); if ( - !!outputs.find( + outputs.find( (output) => ((output as INodeOutputConfiguration)?.type ?? output) !== NodeConnectionTypes.Main, )