mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
refactor(editor): Enable @typescript-eslint/no-base-to-string lint rule, fix errors (no-changelog) (#9783)
This commit is contained in:
parent
e3cbce5028
commit
7e44cd7f16
|
@ -39,7 +39,6 @@ module.exports = {
|
||||||
'@typescript-eslint/restrict-plus-operands': 'warn',
|
'@typescript-eslint/restrict-plus-operands': 'warn',
|
||||||
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
|
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
|
||||||
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
||||||
'@typescript-eslint/no-base-to-string': 'warn',
|
|
||||||
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -887,8 +887,9 @@ export default defineComponent({
|
||||||
this.testedSuccessfully = false;
|
this.testedSuccessfully = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const usesExternalSecrets = Object.entries(credentialDetails.data || {}).some(([, value]) =>
|
const usesExternalSecrets = Object.entries(credentialDetails.data || {}).some(
|
||||||
/=.*\{\{[^}]*\$secrets\.[^}]+}}.*/.test(`${value}`),
|
([, value]) =>
|
||||||
|
typeof value !== 'object' && /=.*\{\{[^}]*\$secrets\.[^}]+}}.*/.test(`${value}`),
|
||||||
);
|
);
|
||||||
|
|
||||||
const trackProperties: ITelemetryTrackProperties = {
|
const trackProperties: ITelemetryTrackProperties = {
|
||||||
|
|
|
@ -132,7 +132,11 @@ const outputTypeParsers: {
|
||||||
} else if (content.id.includes('SystemMessage')) {
|
} else if (content.id.includes('SystemMessage')) {
|
||||||
message = `**System Message:** ${message}`;
|
message = `**System Message:** ${message}`;
|
||||||
}
|
}
|
||||||
if (execData.action && execData.action !== 'getMessages') {
|
if (
|
||||||
|
execData.action &&
|
||||||
|
typeof execData.action !== 'object' &&
|
||||||
|
execData.action !== 'getMessages'
|
||||||
|
) {
|
||||||
message = `## Action: ${execData.action}\n\n${message}`;
|
message = `## Action: ${execData.action}\n\n${message}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -459,7 +459,7 @@ export default defineComponent({
|
||||||
onModalClose() {
|
onModalClose() {
|
||||||
if (!this.hasOnceBeenSaved) {
|
if (!this.hasOnceBeenSaved) {
|
||||||
this.workflowsStore.removeNode(this.node);
|
this.workflowsStore.removeNode(this.node);
|
||||||
if (this.nodeParameters.id) {
|
if (this.nodeParameters.id && typeof this.nodeParameters.id !== 'object') {
|
||||||
this.logStreamingStore.removeDestination(this.nodeParameters.id.toString());
|
this.logStreamingStore.removeDestination(this.nodeParameters.id.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,9 @@ export default defineComponent({
|
||||||
this.uiStore.stateIsDirty = false;
|
this.uiStore.stateIsDirty = false;
|
||||||
|
|
||||||
const destinationType = (
|
const destinationType = (
|
||||||
this.nodeParameters.__type ? `${this.nodeParameters.__type}` : 'unknown'
|
this.nodeParameters.__type && typeof this.nodeParameters.__type !== 'object'
|
||||||
|
? `${this.nodeParameters.__type}`
|
||||||
|
: 'unknown'
|
||||||
)
|
)
|
||||||
.replace('$$MessageEventBusDestination', '')
|
.replace('$$MessageEventBusDestination', '')
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
|
@ -306,7 +306,8 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
|
||||||
if (!showForm) continue;
|
if (!showForm) continue;
|
||||||
|
|
||||||
const { webhookSuffix } = (node.parameters.options ?? {}) as IDataObject;
|
const { webhookSuffix } = (node.parameters.options ?? {}) as IDataObject;
|
||||||
const suffix = webhookSuffix ? `/${webhookSuffix}` : '';
|
const suffix =
|
||||||
|
webhookSuffix && typeof webhookSuffix !== 'object' ? `/${webhookSuffix}` : '';
|
||||||
testUrl = `${rootStore.getFormWaitingUrl}/${runWorkflowApiResponse.executionId}${suffix}`;
|
testUrl = `${rootStore.getFormWaitingUrl}/${runWorkflowApiResponse.executionId}${suffix}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,9 @@ export function getMappedResult(
|
||||||
} else if (typeof prevValue === 'string' && isExpression(prevValue) && prevValue.length > 1) {
|
} else if (typeof prevValue === 'string' && isExpression(prevValue) && prevValue.length > 1) {
|
||||||
return `${prevValue} ${newParamValue}`;
|
return `${prevValue} ${newParamValue}`;
|
||||||
} else if (prevValue && ['string', 'json'].includes(parameter.type)) {
|
} else if (prevValue && ['string', 'json'].includes(parameter.type)) {
|
||||||
return prevValue === '=' ? `=${newParamValue}` : `=${prevValue} ${newParamValue}`;
|
return prevValue === '=' || typeof prevValue === 'object'
|
||||||
|
? `=${newParamValue}`
|
||||||
|
: `=${prevValue} ${newParamValue}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `=${newParamValue}`;
|
return `=${newParamValue}`;
|
||||||
|
|
Loading…
Reference in a new issue