From 6beb45470a19dfd6bb697adfc50283e5b381eb28 Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Tue, 22 Oct 2024 17:16:10 -0300 Subject: [PATCH 1/2] Fix eslint --- .../eslint.config.cjs | 11 ++-- .../botbuilder-dialogs-adaptive/package.json | 1 - .../src/actionContext.ts | 2 +- .../src/actions/actionScope.ts | 5 +- .../src/actions/baseInvokeDialog.ts | 3 +- .../src/actions/beginSkill.ts | 2 +- .../src/actions/cancelAllDialogsBase.ts | 3 +- .../src/actions/continueConversation.ts | 2 +- .../src/actions/continueConversationLater.ts | 2 +- .../src/actions/editActions.ts | 19 ++++--- .../src/actions/editArray.ts | 4 +- .../src/actions/forEach.ts | 2 +- .../src/actions/forEachPage.ts | 2 +- .../src/actions/getConversationMembers.ts | 3 +- .../src/actions/httpRequest.ts | 4 +- .../src/actions/ifCondition.ts | 3 +- .../src/actions/sendActivity.ts | 2 +- .../src/actions/setProperties.ts | 2 +- .../src/actions/switchCondition.ts | 25 +++++----- .../src/actions/telemetryTrackEventAction.ts | 3 +- .../src/actions/updateActivity.ts | 2 +- .../src/adaptiveBotComponent.ts | 4 +- .../src/adaptiveDialog.ts | 45 ++++++++--------- .../src/conditions/onActivity.ts | 2 +- .../src/conditions/onChooseIntent.ts | 10 ++-- .../src/conditions/onCondition.ts | 6 +-- .../src/conditions/onContinueConversation.ts | 2 +- .../src/conditions/onDialogEvent.ts | 2 +- .../src/conditions/onIntent.ts | 4 +- .../src/conditions/onUnknownIntent.ts | 4 +- .../converters/dialogExpressionConverter.ts | 2 +- .../src/dynamicBeginDialogDeserializer.ts | 8 ++- .../src/entityAssignment.ts | 2 +- .../src/entityInfo.ts | 2 + .../generators/languageGeneratorManager.ts | 2 +- .../generators/multiLanguageGeneratorBase.ts | 7 +-- .../resourceMultiLanguageGenerator.ts | 3 +- .../templateEngineLanguageGenerator.ts | 3 +- .../src/input/ask.ts | 4 +- .../src/input/attachmentInput.ts | 2 +- .../src/input/choiceInput.ts | 2 +- .../src/input/confirmInput.ts | 1 - .../src/input/dateTimeInput.ts | 1 - .../src/input/inputDialog.ts | 4 +- .../src/input/oauthInput.ts | 17 +++---- .../src/languageGenerationBotComponent.ts | 2 +- .../src/languageResourceLoader.ts | 6 +-- .../src/recognizers/adaptiveRecognizer.ts | 8 +-- .../recognizers/crossTrainedRecognizerSet.ts | 10 ++-- .../channelMentionEntityRecognizer.ts | 2 +- .../entityRecognizers/entityRecognizer.ts | 6 +-- .../entityRecognizers/entityRecognizerSet.ts | 8 +-- .../entityRecognizers/textEntityRecognizer.ts | 16 +++--- .../recognizers/multiLanguageRecognizer.ts | 8 +-- .../src/recognizers/recognizerSet.ts | 17 +++---- .../src/recognizers/regexRecognizer.ts | 6 +-- .../src/recognizers/valueRecognizer.ts | 4 +- .../src/skillExtensions.ts | 2 +- .../src/templates/activityTemplate.ts | 3 +- .../src/templates/staticActivityTemplate.ts | 3 +- .../src/templates/textTemplate.ts | 3 +- .../tests/LGGenerator.test.js | 6 +-- .../tests/activityFactory.test.js | 12 ++--- .../tests/beginSkill.test.js | 2 +- .../tests/choiceSet.test.ts | 3 +- .../tests/conditionals.test.js | 50 +++++++++---------- .../tests/conversationAction.test.js | 6 +-- .../tests/entityRecognizer.test.js | 4 +- .../tests/entityRecognizerRecognizer.test.js | 2 +- .../tests/expressionProperty.test.ts | 1 - .../tests/languageGeneratorConverter.test.js | 2 +- .../tests/memory_memoryScopes.test.js | 8 +-- .../tests/regexRecognizer.test.js | 9 ++-- .../tests/telemetryUtils.js | 2 +- 74 files changed, 223 insertions(+), 229 deletions(-) diff --git a/libraries/botbuilder-dialogs-adaptive/eslint.config.cjs b/libraries/botbuilder-dialogs-adaptive/eslint.config.cjs index 8a8c64d165..e7903d2781 100644 --- a/libraries/botbuilder-dialogs-adaptive/eslint.config.cjs +++ b/libraries/botbuilder-dialogs-adaptive/eslint.config.cjs @@ -1,13 +1,8 @@ -const onlyWarn = require("eslint-plugin-only-warn"); -const sharedConfig = require("../../eslint.config.cjs") +const sharedConfig = require('../../eslint.config.cjs'); module.exports = [ ...sharedConfig, { - ignores: ["tests/choiceSet.test.js", "tests/expressionProperty.test.js"], + ignores: ['tests/choiceSet.test.js', 'tests/expressionProperty.test.js'], }, - { - plugins: { - "only-warn": onlyWarn, - }, - }]; +]; diff --git a/libraries/botbuilder-dialogs-adaptive/package.json b/libraries/botbuilder-dialogs-adaptive/package.json index e20f5f9a58..73cdc8779d 100644 --- a/libraries/botbuilder-dialogs-adaptive/package.json +++ b/libraries/botbuilder-dialogs-adaptive/package.json @@ -43,7 +43,6 @@ "botbuilder-dialogs-declarative": "4.1.6", "botbuilder-lg": "4.1.6", "botframework-connector": "4.1.6", - "eslint-plugin-only-warn": "^1.1.0", "lodash": "^4.17.21", "node-fetch": "^2.7.0" }, diff --git a/libraries/botbuilder-dialogs-adaptive/src/actionContext.ts b/libraries/botbuilder-dialogs-adaptive/src/actionContext.ts index a3c5385057..31797e24a2 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actionContext.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actionContext.ts @@ -32,7 +32,7 @@ export class ActionContext extends DialogContext { parentDialogContext: DialogContext, state: DialogState, actions: ActionState[], - changeKey: symbol + changeKey: symbol, ) { super(dialogs, parentDialogContext, state); this.actions = actions; diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/actionScope.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/actionScope.ts index 048702e7c7..fe99b3ea9e 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/actionScope.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/actionScope.ts @@ -42,7 +42,8 @@ export interface ActionScopeConfiguration extends DialogConfiguration { */ export class ActionScope extends Dialog - implements DialogDependencies, ActionScopeConfiguration { + implements DialogDependencies, ActionScopeConfiguration +{ /** * Creates a new `ActionScope` instance. * @@ -144,7 +145,7 @@ export class ActionScope */ protected async onActionScopeResult( dc: DialogContext, - actionScopeResult: ActionScopeResult + actionScopeResult: ActionScopeResult, ): Promise { switch (actionScopeResult.actionScopeCommand) { case ActionScopeCommands.GotoAction: diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/baseInvokeDialog.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/baseInvokeDialog.ts index 7512fb9965..418ecf13a9 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/baseInvokeDialog.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/baseInvokeDialog.ts @@ -39,7 +39,8 @@ export interface BaseInvokeDialogConfiguration extends DialogConfiguration { */ export class BaseInvokeDialog extends Dialog - implements DialogDependencies, BaseInvokeDialogConfiguration { + implements DialogDependencies, BaseInvokeDialogConfiguration +{ /** * Initializes a new instance of the [BaseInvokeDialog](xref:botbuilder-dialogs-adaptive.BaseInvokeDialog) class. * diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/beginSkill.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/beginSkill.ts index e5f096efc9..d8bfc719f8 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/beginSkill.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/beginSkill.ts @@ -165,7 +165,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration { const { conversationState, skillClient, conversationIdFactory, ...rest } = this; return rest; }, - }) + }), ); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/cancelAllDialogsBase.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/cancelAllDialogsBase.ts index 185942f319..17bc2652f0 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/cancelAllDialogsBase.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/cancelAllDialogsBase.ts @@ -39,7 +39,8 @@ export interface CancelAllDialogsBaseConfiguration extends DialogConfiguration { */ export class CancelAllDialogsBase extends Dialog - implements CancelAllDialogsBaseConfiguration { + implements CancelAllDialogsBaseConfiguration +{ constructor(); /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversation.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversation.ts index 740821db3e..d86d005fe6 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversation.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversation.ts @@ -100,7 +100,7 @@ export class ContinueConversation extends Dialog implements ContinueConversation value: this.value?.getValue(dc.state), }, conversationReference, - true + true, ); const queueStorage: QueueStorage = dc.context.turnState.get(DialogTurnStateConstants.queueStorage); diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversationLater.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversationLater.ts index 0086d235c9..6d95e4a5cb 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversationLater.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/continueConversationLater.ts @@ -110,7 +110,7 @@ export class ContinueConversationLater extends Dialog implements ContinueConvers relatesTo: reference as ConversationReference, }, reference, - true + true, ); activity.value = this.value && this.value.getValue(dc.state); diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/editActions.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/editActions.ts index 3a30392267..23aa80c6e7 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/editActions.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/editActions.ts @@ -36,7 +36,8 @@ export interface EditActionsConfiguration extends DialogConfiguration { */ export class EditActions extends Dialog - implements DialogDependencies, EditActionsConfiguration { + implements DialogDependencies, EditActionsConfiguration +{ static $kind = 'Microsoft.EditActions'; constructor(); @@ -120,15 +121,13 @@ export class EditActions } if (dc.parent instanceof ActionContext) { - const planActions = this.actions.map( - (action: Dialog): ActionState => { - return { - dialogStack: [], - dialogId: action.id, - options: options, - }; - } - ); + const planActions = this.actions.map((action: Dialog): ActionState => { + return { + dialogStack: [], + dialogId: action.id, + options: options, + }; + }); const changes: ActionChangeList = { changeType: this.changeType.getValue(dc.state), diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/editArray.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/editArray.ts index 50c2aa1369..b189a7aa04 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/editArray.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/editArray.ts @@ -152,7 +152,7 @@ export class EditArray extends Dialog implements EditA if (!this.itemsProperty) { throw new Error( - `EditArray: "${this.changeType.toString()}" operation couldn't be performed because the itemsProperty wasn't specified.` + `EditArray: "${this.changeType.toString()}" operation couldn't be performed because the itemsProperty wasn't specified.`, ); } @@ -224,7 +224,7 @@ export class EditArray extends Dialog implements EditA throw new Error( `EditArray: "${this.changeType.toString()}" operation couldn't be performed for list "${ this.itemsProperty - }" because a value wasn't specified.` + }" because a value wasn't specified.`, ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/forEach.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/forEach.ts index f00525e149..2febb0b645 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/forEach.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/forEach.ts @@ -145,7 +145,7 @@ export class ForEach extends ActionScope implements Fo */ protected async onContinueLoop( dc: DialogContext, - _actionScopeResult: ActionScopeResult + _actionScopeResult: ActionScopeResult, ): Promise { return await this.nextItem(dc); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/forEachPage.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/forEachPage.ts index d13a7b4708..982facf1ca 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/forEachPage.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/forEachPage.ts @@ -162,7 +162,7 @@ export class ForEachPage extends ActionScope implement */ protected async onContinueLoop( dc: DialogContext, - _actionScopeResult: ActionScopeResult + _actionScopeResult: ActionScopeResult, ): Promise { return await this.nextPage(dc); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/getConversationMembers.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/getConversationMembers.ts index 649ee25c0a..1526951cf4 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/getConversationMembers.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/getConversationMembers.ts @@ -35,7 +35,8 @@ export interface GetConversationMembersConfiguration extends DialogConfiguration */ export class GetConversationMembers extends Dialog - implements GetConversationMembersConfiguration { + implements GetConversationMembersConfiguration +{ static $kind = 'Microsoft.GetConversationMembers'; constructor(); diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts index 128cbc9e93..cfe0050c0f 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts @@ -6,10 +6,10 @@ * Licensed under the MIT License. */ import { StatusCodes } from 'botbuilder-core'; -import fetch, { FetchError } from 'node-fetch'; +import fetch, { FetchError, Response, Headers } from 'node-fetch'; import { Activity } from 'botbuilder'; import { BoolProperty, EnumProperty, StringProperty, UnknownProperty } from '../properties'; -import { Response, Headers } from 'node-fetch'; + import { evaluateExpression } from '../jsonExtensions'; import { diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/ifCondition.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/ifCondition.ts index e6927bdfc7..a3fcafc9fd 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/ifCondition.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/ifCondition.ts @@ -33,7 +33,8 @@ export interface IfConditionConfiguration extends DialogConfiguration { */ export class IfCondition extends Dialog - implements DialogDependencies, IfConditionConfiguration { + implements DialogDependencies, IfConditionConfiguration +{ static $kind = 'Microsoft.IfCondition'; constructor(); diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/sendActivity.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/sendActivity.ts index b7aae98699..e4c73452d3 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/sendActivity.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/sendActivity.ts @@ -102,7 +102,7 @@ export class SendActivity extends Dialog implements Se { utterance: dc.context.activity.text || '', }, - options + options, ); const activityResult = await this.activity.bind(dc, data); diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/setProperties.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/setProperties.ts index 08caf92cf1..656dd6a50d 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/setProperties.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/setProperties.ts @@ -123,7 +123,7 @@ export class SetProperties extends Dialog implements S protected onComputeId(): string { return `SetProperties[${StringUtils.ellipsis( this.assignments.map((item): string => item.property.toString()).join(','), - 50 + 50, )}]`; } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/switchCondition.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/switchCondition.ts index b9f692e2a5..9e180671de 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/switchCondition.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/switchCondition.ts @@ -39,7 +39,7 @@ type CaseInput = { class CasesConverter implements Converter, Case[]> { convert(items: Array): Case[] { return items.map( - (item: CaseInput | Case): Case => (item instanceof Case ? item : new Case(item.value, item.actions)) + (item: CaseInput | Case): Case => (item instanceof Case ? item : new Case(item.value, item.actions)), ); } } @@ -59,7 +59,8 @@ export interface SwitchConditionConfiguration extends DialogConfiguration { */ export class SwitchCondition extends Dialog - implements DialogDependencies, SwitchConditionConfiguration { + implements DialogDependencies, SwitchConditionConfiguration +{ static $kind = 'Microsoft.SwitchCondition'; constructor(); @@ -176,8 +177,8 @@ export class SwitchCondition caseScope.value, Expression.orExpression( Expression.equalsExpression(this.condition, new Constant(intVal)), - Expression.equalsExpression(this.condition, new Constant(caseScope.value)) - ) + Expression.equalsExpression(this.condition, new Constant(caseScope.value)), + ), ); continue; } @@ -188,8 +189,8 @@ export class SwitchCondition caseScope.value, Expression.orExpression( Expression.equalsExpression(this.condition, new Constant(floatVal)), - Expression.equalsExpression(this.condition, new Constant(caseScope.value)) - ) + Expression.equalsExpression(this.condition, new Constant(caseScope.value)), + ), ); continue; } @@ -200,8 +201,8 @@ export class SwitchCondition caseScope.value, Expression.orExpression( Expression.equalsExpression(this.condition, new Constant(true)), - Expression.equalsExpression(this.condition, new Constant(caseScope.value)) - ) + Expression.equalsExpression(this.condition, new Constant(caseScope.value)), + ), ); continue; } @@ -211,8 +212,8 @@ export class SwitchCondition caseScope.value, Expression.orExpression( Expression.equalsExpression(this.condition, new Constant(false)), - Expression.equalsExpression(this.condition, new Constant(caseScope.value)) - ) + Expression.equalsExpression(this.condition, new Constant(caseScope.value)), + ), ); continue; } @@ -221,7 +222,7 @@ export class SwitchCondition const { value } = new ValueExpression(caseScope.value).tryGetValue(dc.state); this._caseExpresssions.set( caseScope.value, - Expression.equalsExpression(this.condition, new Constant(value)) + Expression.equalsExpression(this.condition, new Constant(value)), ); } } @@ -234,7 +235,7 @@ export class SwitchCondition const { value, error } = caseCondition.tryEvaluate(dc.state); if (error) { throw new Error( - `Expression evaluation resulted in an error. Expression: ${caseCondition.toString()}. Error: ${error}` + `Expression evaluation resulted in an error. Expression: ${caseCondition.toString()}. Error: ${error}`, ); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/telemetryTrackEventAction.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/telemetryTrackEventAction.ts index 764d09453d..c9d27d41f0 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/telemetryTrackEventAction.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/telemetryTrackEventAction.ts @@ -55,7 +55,8 @@ export interface TelemetryTrackEventActionConfiguration extends DialogConfigurat */ export class TelemetryTrackEventAction extends Dialog - implements TelemetryTrackEventActionConfiguration { + implements TelemetryTrackEventActionConfiguration +{ static $kind = 'Microsoft.TelemetryTrackEventAction'; /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/updateActivity.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/updateActivity.ts index 8c665b7822..7c481d0d15 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/updateActivity.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/updateActivity.ts @@ -120,7 +120,7 @@ export class UpdateActivity extends Dialog implements utterance: dc.context.activity.text || '', }, dc.state, - options + options, ); const activityResult = await this.activity.bind(dc, data); diff --git a/libraries/botbuilder-dialogs-adaptive/src/adaptiveBotComponent.ts b/libraries/botbuilder-dialogs-adaptive/src/adaptiveBotComponent.ts index 77d0f0fbfd..dde9a1dc98 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/adaptiveBotComponent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/adaptiveBotComponent.ts @@ -272,8 +272,8 @@ export class AdaptiveBotComponent extends BotComponent { loader: new DynamicBeginDialogDeserializer(resourceExplorer, resourceId), })); }, - } - ) + }, + ), ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/adaptiveDialog.ts b/libraries/botbuilder-dialogs-adaptive/src/adaptiveDialog.ts index ff69c5b504..740459f348 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/adaptiveDialog.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/adaptiveDialog.ts @@ -58,9 +58,8 @@ import { FirstSelector, MostSpecificSelector } from './selectors'; import { TriggerSelector } from './triggerSelector'; import { TelemetryLoggerConstants } from './telemetryLoggerConstants'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any function isDialogDependencies(val: any): val is DialogDependencies { - return typeof ((val as unknown) as DialogDependencies).getDependencies === 'function'; + return typeof (val as unknown as DialogDependencies).getDependencies === 'function'; } export interface AdaptiveDialogConfiguration extends DialogConfiguration { @@ -485,7 +484,7 @@ export class AdaptiveDialog extends DialogContainer im protected async processEvent( actionContext: ActionContext, dialogEvent: DialogEvent, - preBubble: boolean + preBubble: boolean, ): Promise { // Save into turn actionContext.state.setValue(TurnPath.dialogEvent, dialogEvent); @@ -501,7 +500,7 @@ export class AdaptiveDialog extends DialogContainer im // we have received a RecognizedIntent event // get the value and promote to turn.recognized, topintent, topscore and lastintent const recognizedResult = actionContext.state.getValue( - `${TurnPath.dialogEvent}.value` + `${TurnPath.dialogEvent}.value`, ); const { intent, score } = getTopScoringIntent(recognizedResult); actionContext.state.setValue(TurnPath.recognized, recognizedResult); @@ -1069,7 +1068,7 @@ export class AdaptiveDialog extends DialogContainer im properties: string[], turn: number, text: string, - entityToInfo: Record + entityToInfo: Record, ): void { Object.keys(entities).forEach((entityName) => { const instances = entities[this.instanceKey][entityName]; @@ -1084,7 +1083,7 @@ export class AdaptiveDialog extends DialogContainer im properties, turn, text, - entityToInfo + entityToInfo, ); }); } @@ -1103,7 +1102,7 @@ export class AdaptiveDialog extends DialogContainer im properties: string[], turn: number, text: string, - entityToInfo: Record + entityToInfo: Record, ): void { if (!name.startsWith('$')) { // Entities representing schema properties end in "Property" to prevent name collisions with the property itself. @@ -1140,7 +1139,7 @@ export class AdaptiveDialog extends DialogContainer im property, turn, text, - entityToInfo + entityToInfo, ); } else if (typeof entity === 'object' && entity !== null) { if (isEmpty(entity)) { @@ -1161,7 +1160,7 @@ export class AdaptiveDialog extends DialogContainer im properties, turn, text, - entityToInfo + entityToInfo, ); } } else if (isOp) { @@ -1185,7 +1184,7 @@ export class AdaptiveDialog extends DialogContainer im property: string, turn: number, text: string, - entityToInfo: Record + entityToInfo: Record, ): void { if (instance && rootInstance) { entityToInfo[name] ??= []; @@ -1224,7 +1223,7 @@ export class AdaptiveDialog extends DialogContainer im lastEvent: string, nextAssignment: EntityAssignment, askDefault: Record, - dialogDefault: Record + dialogDefault: Record, ): EntityAssignment[] { const globalExpectedOnly: string[] = this.dialogSchema.schema[this.expectedOnlyKey] ?? []; const requiresValue: string[] = this.dialogSchema.schema[this.requiresValueKey] ?? []; @@ -1240,7 +1239,7 @@ export class AdaptiveDialog extends DialogContainer im property: alternative.property, operation: alternative.operation, isExpected: expected.includes(alternative.property), - }) + }), ); } }); @@ -1262,7 +1261,7 @@ export class AdaptiveDialog extends DialogContainer im property: propSchema.name, operation: entity.operation, isExpected, - }) + }), ); } else if (entity.property === entityName && !entity.value && !entity.operation && isExpected) { // Recast property with no value as match for property entities. @@ -1272,7 +1271,7 @@ export class AdaptiveDialog extends DialogContainer im property: propSchema.name, operation: null, isExpected, - }) + }), ); } } @@ -1305,7 +1304,7 @@ export class AdaptiveDialog extends DialogContainer im if (!alternative.value) { // If alternative matches one alternative, it answers chooseProperty. const matches = nextAssignment.alternatives.filter((a) => - this.matchesAssignment(alternative, a) + this.matchesAssignment(alternative, a), ); if (matches.length === 1) { assignments.push( @@ -1313,7 +1312,7 @@ export class AdaptiveDialog extends DialogContainer im value: alternative, operation: AdaptiveEvents.chooseProperty, isExpected: true, - }) + }), ); } } @@ -1331,7 +1330,7 @@ export class AdaptiveDialog extends DialogContainer im property: null, operation: alternative.operation, isExpected: false, - }) + }), ); } }); @@ -1383,7 +1382,7 @@ export class AdaptiveDialog extends DialogContainer im private defaultOperation( assignment: EntityAssignment, askDefault: Record, - dialogDefault: Record + dialogDefault: Record, ): string { let operation: string; if (assignment.property) { @@ -1411,7 +1410,7 @@ export class AdaptiveDialog extends DialogContainer im ...acc, [assignment.property]: [...(acc[assignment.property] ?? []), assignment], }), - {} + {}, ); const output: EntityAssignment[] = []; @@ -1433,7 +1432,7 @@ export class AdaptiveDialog extends DialogContainer im (choice): boolean => !isEqual(choice, candidate) || (EntityInfo.sharesRoot(choice.value, candidate.value) && - !EntityInfo.overlaps(choice.value, candidate.value)) + !EntityInfo.overlaps(choice.value, candidate.value)), ); output.push(candidate); } @@ -1449,7 +1448,7 @@ export class AdaptiveDialog extends DialogContainer im actionContext: ActionContext, entities: NormalizedEntityInfos, existing: EntityAssignments, - lastEvent: string + lastEvent: string, ): Partial[] { const assignments = new EntityAssignments(); const expected: string[] = actionContext.state.getValue(DialogPath.expectedProperties, []); @@ -1462,7 +1461,7 @@ export class AdaptiveDialog extends DialogContainer im const nextAssignment = existing.nextAssignment; let candidates = this.removeOverlappingPerProperty( - this.candidates(entities, expected, lastEvent, nextAssignment, askDefaultOp, defaultOp) + this.candidates(entities, expected, lastEvent, nextAssignment, askDefaultOp, defaultOp), ).sort((a, b): number => (a.isExpected === b.isExpected ? 0 : a.isExpected ? -1 : 1)); const usedEntities = new Set(candidates.map((candidate) => candidate.value)); @@ -1607,7 +1606,7 @@ export class AdaptiveDialog extends DialogContainer im private mergeAssignments( newAssignments: EntityAssignments, old: EntityAssignments, - comparer: EntityAssignmentComparer + comparer: EntityAssignmentComparer, ): void { let list = old.assignments; for (const assign of newAssignments.assignments) { diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onActivity.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onActivity.ts index 43c149d66a..65254a50dd 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onActivity.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onActivity.ts @@ -46,7 +46,7 @@ export class OnActivity extends OnDialogEvent implements OnActivityConfiguration // add constraints for activity type return Expression.andExpression( Expression.parse(`${TurnPath.activity}.type == '${this.type}'`), - super.createExpression() + super.createExpression(), ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onChooseIntent.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onChooseIntent.ts index c0770234e2..13bd9426c8 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onChooseIntent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onChooseIntent.ts @@ -39,13 +39,9 @@ export class OnChooseIntent extends OnIntent implements OnChooseIntentConfigurat */ protected createExpression(): Expression { if (this.intents?.length) { - const constraints = this.intents.map( - (intent: string): Expression => { - return Expression.parse( - `contains(jPath(${TurnPath.recognized}, '.candidates.intent'), '${intent}')` - ); - } - ); + const constraints = this.intents.map((intent: string): Expression => { + return Expression.parse(`contains(jPath(${TurnPath.recognized}, '.candidates.intent'), '${intent}')`); + }); return Expression.andExpression(super.createExpression(), ...constraints); } return super.createExpression(); diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onCondition.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onCondition.ts index 545e2f8b1b..5056128a32 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onCondition.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onCondition.ts @@ -226,14 +226,14 @@ export class OnCondition extends Configurable implements DialogDependencies, OnC return { value: changed, error: undefined }; }, ReturnType.Boolean, - FunctionUtils.validateUnary + FunctionUtils.validateUnary, ); allExpressions.push( new Expression( ExpressionType.Ignore, Expression.lookup(ExpressionType.Ignore), - new Expression(evaluator.type, evaluator) - ) + new Expression(evaluator.type, evaluator), + ), ); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onContinueConversation.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onContinueConversation.ts index f1862c696c..9b0280e6f0 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onContinueConversation.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onContinueConversation.ts @@ -34,7 +34,7 @@ export class OnContinueConversation extends OnEventActivity { // add constraints for activity type return Expression.andExpression( Expression.parse(`${TurnPath.activity}.name == 'ContinueConversation'`), - super.createExpression() + super.createExpression(), ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onDialogEvent.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onDialogEvent.ts index 0f5d364cee..2d37738c66 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onDialogEvent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onDialogEvent.ts @@ -44,7 +44,7 @@ export class OnDialogEvent extends OnCondition implements OnDialogEventConfigura protected createExpression(): Expression { return Expression.andExpression( Expression.parse(`${TurnPath.dialogEvent}.name == '${this.event}'`), - super.createExpression() + super.createExpression(), ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onIntent.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onIntent.ts index 611bf99629..11e4c44d60 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onIntent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onIntent.ts @@ -73,8 +73,8 @@ export class OnIntent extends OnDialogEvent implements OnIntentConfiguration { return Expression.parse(`exists(${entity})`); } return Expression.parse(`exists(@${entity})`); - }) - ) + }), + ), ); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/conditions/onUnknownIntent.ts b/libraries/botbuilder-dialogs-adaptive/src/conditions/onUnknownIntent.ts index 05c368a322..6615e60e92 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/conditions/onUnknownIntent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/conditions/onUnknownIntent.ts @@ -17,8 +17,8 @@ import { OnDialogEvent } from './onDialogEvent'; * there is no active plan being executed. * This trigger is run when the utterance is not recognized and the fallback consultation is happening * It will only trigger if and when - * * it is the leaf dialog AND - * * none of the parent dialogs handle the event + * it is the leaf dialog AND + * none of the parent dialogs handle the event * This provides the parent dialogs the opportunity to handle global commands as fallback interruption. */ export class OnUnknownIntent extends OnDialogEvent { diff --git a/libraries/botbuilder-dialogs-adaptive/src/converters/dialogExpressionConverter.ts b/libraries/botbuilder-dialogs-adaptive/src/converters/dialogExpressionConverter.ts index 860ff3af6f..c2c79f792a 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/converters/dialogExpressionConverter.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/converters/dialogExpressionConverter.ts @@ -42,6 +42,6 @@ export class DialogExpressionConverter implements Converter { + implements CustomDeserializer +{ /** * Intializes an instance of `DynamicBeginDialogDeserializer`. * * @param _resourceExplorer The `ResourceExplorer` used by the deserializer. * @param _resourceId The resource id of the dynamic dialog. */ - constructor(private readonly _resourceExplorer: ResourceExplorer, private readonly _resourceId: string) {} + constructor( + private readonly _resourceExplorer: ResourceExplorer, + private readonly _resourceId: string, + ) {} /** * The method that loads the configuration object to a `DynamicBeginDialog` object. diff --git a/libraries/botbuilder-dialogs-adaptive/src/entityAssignment.ts b/libraries/botbuilder-dialogs-adaptive/src/entityAssignment.ts index 980b93e410..5ec4a21d1b 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/entityAssignment.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/entityAssignment.ts @@ -157,7 +157,7 @@ export class EntityAssignment implements EntityAssignmentConfiguration { */ toString(): string { return `${this.isExpected ? '+' : ''}${this.event}: ${this.property} = ${this.operation}(${EntityInfo.toString( - this.value + this.value, )})`; } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/entityInfo.ts b/libraries/botbuilder-dialogs-adaptive/src/entityInfo.ts index ef60e8b110..c9a4d36a2e 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/entityInfo.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/entityInfo.ts @@ -9,6 +9,7 @@ /** * Extended information about an entity including $instance data. */ +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export interface EntityInfo { /** * Name of entity. @@ -86,6 +87,7 @@ export interface NormalizedEntityInfos { /** * Extended information about an entity including $instance data. */ +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export class EntityInfo { /** * Print an entity as a string. diff --git a/libraries/botbuilder-dialogs-adaptive/src/generators/languageGeneratorManager.ts b/libraries/botbuilder-dialogs-adaptive/src/generators/languageGeneratorManager.ts index 898a8a3542..a673f2fd66 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/generators/languageGeneratorManager.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/generators/languageGeneratorManager.ts @@ -81,7 +81,7 @@ export class LanguageGeneratorManager LanguageResourceLoader.parseLGFileName(u.id).prefix === - LanguageResourceLoader.parseLGFileName(resourceName).prefix + LanguageResourceLoader.parseLGFileName(resourceName).prefix, ); if (resource === undefined) { diff --git a/libraries/botbuilder-dialogs-adaptive/src/generators/multiLanguageGeneratorBase.ts b/libraries/botbuilder-dialogs-adaptive/src/generators/multiLanguageGeneratorBase.ts index 8642867c96..f46b9610f3 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/generators/multiLanguageGeneratorBase.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/generators/multiLanguageGeneratorBase.ts @@ -20,10 +20,11 @@ export interface MultiLanguageGeneratorBaseConfiguration { */ export abstract class MultiLanguageGeneratorBase< T = unknown, - D extends Record = Record + D extends Record = Record, > extends Configurable - implements LanguageGenerator, MultiLanguageGeneratorBaseConfiguration { + implements LanguageGenerator, MultiLanguageGeneratorBaseConfiguration +{ /** * Language policy required by language generator. */ @@ -50,7 +51,7 @@ export abstract class MultiLanguageGeneratorBase< */ abstract tryGetGenerator( dialogContext: DialogContext, - locale: string + locale: string, ): { exist: boolean; result: LanguageGenerator }; /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/generators/resourceMultiLanguageGenerator.ts b/libraries/botbuilder-dialogs-adaptive/src/generators/resourceMultiLanguageGenerator.ts index 01e322ea12..54d91a72c3 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/generators/resourceMultiLanguageGenerator.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/generators/resourceMultiLanguageGenerator.ts @@ -26,7 +26,8 @@ export interface ResourceMultiLanguageGeneratorConfiguration extends MultiLangua */ export class ResourceMultiLanguageGenerator = Record> extends MultiLanguageGeneratorBase - implements ResourceMultiLanguageGeneratorConfiguration { + implements ResourceMultiLanguageGeneratorConfiguration +{ static $kind = 'Microsoft.ResourceMultiLanguageGenerator'; /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/generators/templateEngineLanguageGenerator.ts b/libraries/botbuilder-dialogs-adaptive/src/generators/templateEngineLanguageGenerator.ts index 517be513f6..4be3e1e712 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/generators/templateEngineLanguageGenerator.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/generators/templateEngineLanguageGenerator.ts @@ -22,7 +22,8 @@ export interface TemplateEngineLanguageGeneratorConfiguration { */ export class TemplateEngineLanguageGenerator = Record> extends Configurable - implements LanguageGenerator, TemplateEngineLanguageGeneratorConfiguration { + implements LanguageGenerator, TemplateEngineLanguageGeneratorConfiguration +{ static $kind = 'Microsoft.TemplateEngineLanguageGenerator'; private readonly DEFAULTLABEL: string = 'Unknown'; diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/ask.ts b/libraries/botbuilder-dialogs-adaptive/src/input/ask.ts index a48a533617..db64376fb4 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/ask.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/ask.ts @@ -111,10 +111,10 @@ export class Ask extends SendActivity implements AskConfiguration { lastTrigger && !expected.some( (prop: string): boolean => - !lastExpectedProperties.some((lastProp: string): boolean => lastProp === prop) + !lastExpectedProperties.some((lastProp: string): boolean => lastProp === prop), ) && !lastExpectedProperties.some( - (lastProp: string): boolean => !expected.some((prop: string): boolean => prop === lastProp) + (lastProp: string): boolean => !expected.some((prop: string): boolean => prop === lastProp), ) && lastTrigger.name === trigger.name ) { diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/attachmentInput.ts b/libraries/botbuilder-dialogs-adaptive/src/input/attachmentInput.ts index cecfa01770..7c9d424107 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/attachmentInput.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/attachmentInput.ts @@ -26,7 +26,7 @@ export interface AttachmentInputConfiguration extends InputDialogConfiguration { export class AttachmentInput extends InputDialog implements AttachmentInputConfiguration { static $kind = 'Microsoft.AttachmentInput'; outputFormat: EnumExpression = new EnumExpression( - AttachmentOutputFormat.first + AttachmentOutputFormat.first, ); /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/choiceInput.ts b/libraries/botbuilder-dialogs-adaptive/src/input/choiceInput.ts index 4c383b6921..af118bfed1 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/choiceInput.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/choiceInput.ts @@ -141,7 +141,7 @@ export class ChoiceInput extends InputDialog implements ChoiceInputConfiguration protected trackGeneratorResultEvent( dc: DialogContext, activityTemplate: TemplateInterface, DialogStateManager>, - msg: Partial + msg: Partial, ): void { const options = dc.state.getValue(ChoiceInput.OPTIONS_PROPERTY); const properties = { diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/confirmInput.ts b/libraries/botbuilder-dialogs-adaptive/src/input/confirmInput.ts index 2c5bf848ae..f0e34c5436 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/confirmInput.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/confirmInput.ts @@ -31,7 +31,6 @@ import { recognizeChoices, } from 'botbuilder-dialogs'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Recognizers from '@microsoft/recognizers-text-choice'; import { ChoiceOptionsSet } from './choiceOptionsSet'; diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/dateTimeInput.ts b/libraries/botbuilder-dialogs-adaptive/src/input/dateTimeInput.ts index 3428502491..b61ab7bf13 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/dateTimeInput.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/dateTimeInput.ts @@ -11,7 +11,6 @@ import { StringExpression, StringExpressionConverter } from 'adaptive-expression import { InputDialog, InputDialogConfiguration, InputState } from './inputDialog'; import { StringProperty } from '../properties'; -// eslint-disable-next-line import/no-extraneous-dependencies import * as Recognizers from '@microsoft/recognizers-text-date-time'; export interface DateTimeInputConfiguration extends InputDialogConfiguration { diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/inputDialog.ts b/libraries/botbuilder-dialogs-adaptive/src/input/inputDialog.ts index de0146bdd3..7533247c1b 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/inputDialog.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/inputDialog.ts @@ -397,7 +397,7 @@ export abstract class InputDialog extends Dialog implements InputDialogConfigura protected trackGeneratorResultEvent( dc: DialogContext, activityTemplate: TemplateInterface, DialogStateManager>, - msg: Partial + msg: Partial, ): void { this.telemetryClient.trackEvent({ name: TelemetryLoggerConstants.GeneratorResultEvent, @@ -424,7 +424,7 @@ export abstract class InputDialog extends Dialog implements InputDialogConfigura channelId: string, choices: Choice[], style: ListStyle, - options?: ChoiceFactoryOptions + options?: ChoiceFactoryOptions, ): Partial { // Create temporary msg let msg: Partial; diff --git a/libraries/botbuilder-dialogs-adaptive/src/input/oauthInput.ts b/libraries/botbuilder-dialogs-adaptive/src/input/oauthInput.ts index 1dba2fdf9b..588f3ffc1d 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/input/oauthInput.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/input/oauthInput.ts @@ -15,6 +15,13 @@ import { tokenExchangeOperationName, tokenResponseEventName, verifyStateOperationName, + Activity, + ActivityTypes, + InputHints, + StatusCodes, + TokenExchangeInvokeRequest, + TokenResponse, + TurnContext, } from 'botbuilder'; import { @@ -25,16 +32,6 @@ import { StringExpressionConverter, } from 'adaptive-expressions'; -import { - Activity, - ActivityTypes, - InputHints, - StatusCodes, - TokenExchangeInvokeRequest, - TokenResponse, - TurnContext, -} from 'botbuilder'; - import { Converter, ConverterFactory, diff --git a/libraries/botbuilder-dialogs-adaptive/src/languageGenerationBotComponent.ts b/libraries/botbuilder-dialogs-adaptive/src/languageGenerationBotComponent.ts index dd55d518d5..858cb7a71a 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/languageGenerationBotComponent.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/languageGenerationBotComponent.ts @@ -33,7 +33,7 @@ export class LanguageGenerationBotComponent extends BotComponent { }, ]; }, - }) + }), ); } } diff --git a/libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts b/libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts index cd067dfeda..2ee8a2944a 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/languageResourceLoader.ts @@ -36,7 +36,7 @@ export class LanguageResourceLoader { const suffix = suffixs[index]; const resourcesWithSuffix = allResouces.filter( (u): boolean => - this.parseLGFileName(u.id).language.toLocaleLowerCase() === suffix.toLocaleLowerCase() + this.parseLGFileName(u.id).language.toLocaleLowerCase() === suffix.toLocaleLowerCase(), ); resourcesWithSuffix.forEach((u): void => { const resourceName = u.id; @@ -57,7 +57,7 @@ export class LanguageResourceLoader { if (resourceMapping.has(locale)) { const resourcesWithEmptySuffix = allResouces.filter( - (u): boolean => this.parseLGFileName(u.id).language === '' + (u): boolean => this.parseLGFileName(u.id).language === '', ); resourcesWithEmptySuffix.forEach((u): void => { const resourceName = u.id; @@ -133,7 +133,7 @@ export class LanguageResourceLoader { for (const currentLocale of resourceMapping.keys()) { const currentResourcePool: Resource[] = resourceMapping.get(currentLocale); const existLocale = Array.from(resourcePoolDict.keys()).find((u) => - this.hasSameResourcePool(resourcePoolDict.get(u), currentResourcePool) + this.hasSameResourcePool(resourcePoolDict.get(u), currentResourcePool), ); if (existLocale === undefined) { resourcePoolDict.set(currentLocale, currentResourcePool); diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/adaptiveRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/adaptiveRecognizer.ts index 0ea6d56b13..22591c4279 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/adaptiveRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/adaptiveRecognizer.ts @@ -22,7 +22,7 @@ export abstract class AdaptiveRecognizer extends Recognizer implements AdaptiveR * (Optional) Flag that designates whether personally identifiable information (PII) should log to telemetry. */ logPersonalInformation: BoolExpression = new BoolExpression( - '=settings.runtimeSettings.telemetry.logPersonalInformation' + '=settings.runtimeSettings.telemetry.logPersonalInformation', ); /** @@ -36,11 +36,11 @@ export abstract class AdaptiveRecognizer extends Recognizer implements AdaptiveR protected fillRecognizerResultTelemetryProperties( recognizerResult: RecognizerResult, telemetryProperties: Record, - dialogContext: DialogContext + dialogContext: DialogContext, ): Record { if (!dialogContext) { throw new Error( - 'DialogContext needed for state in AdaptiveRecognizer.fillRecognizerResultTelemetryProperties method.' + 'DialogContext needed for state in AdaptiveRecognizer.fillRecognizerResultTelemetryProperties method.', ); } const { intent, score } = getTopScoringIntent(recognizerResult); @@ -51,7 +51,7 @@ export abstract class AdaptiveRecognizer extends Recognizer implements AdaptiveR Intents: intentsCount > 0 ? JSON.stringify(recognizerResult.intents) : undefined, Entities: recognizerResult.entities ? JSON.stringify(recognizerResult.entities) : undefined, AdditionalProperties: JSON.stringify( - omit(recognizerResult, ['text', 'alteredText', 'intents', 'entities']) + omit(recognizerResult, ['text', 'alteredText', 'intents', 'entities']), ), }; diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/crossTrainedRecognizerSet.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/crossTrainedRecognizerSet.ts index 7deaf1739a..2f964dfde3 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/crossTrainedRecognizerSet.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/crossTrainedRecognizerSet.ts @@ -60,7 +60,7 @@ export class CrossTrainedRecognizerSet extends AdaptiveRecognizer implements Cro dialogContext: DialogContext, activity: Activity, telemetryProperties?: Record, - telemetryMetrics?: Record + telemetryMetrics?: Record, ): Promise { if (!this.recognizers.length) { return { @@ -80,11 +80,11 @@ export class CrossTrainedRecognizerSet extends AdaptiveRecognizer implements Cro dialogContext, activity, telemetryProperties, - telemetryMetrics + telemetryMetrics, ); result['id'] = recognizer.id; return result; - }) + }), ); const result = this.processResults(results); @@ -92,7 +92,7 @@ export class CrossTrainedRecognizerSet extends AdaptiveRecognizer implements Cro dialogContext, TelemetryLoggerConstants.CrossTrainedRecognizerSetResultEvent, this.fillRecognizerResultTelemetryProperties(result, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return result; } @@ -162,7 +162,7 @@ export class CrossTrainedRecognizerSet extends AdaptiveRecognizer implements Cro // filter out redirect results and return `ChooseIntent`. const recognizersWithRealIntents = pickBy( recognizerResults, - (value) => !this.isRedirect(getTopScoringIntent(value).intent) + (value) => !this.isRedirect(getTopScoringIntent(value).intent), ); return this.createChooseIntentResult(recognizersWithRealIntents); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/channelMentionEntityRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/channelMentionEntityRecognizer.ts index 116d111294..56a799be25 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/channelMentionEntityRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/channelMentionEntityRecognizer.ts @@ -29,7 +29,7 @@ export class ChannelMentionEntityRecognizer extends AdaptiveRecognizer { _dialogContext: DialogContext, activity: Partial, _telemetryProperties?: Record, - _telemetryMetrics?: Record + _telemetryMetrics?: Record, ): Promise { const result: RecognizerResult = { text: '', diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizer.ts index 194e0e0c72..01fa2ec0b6 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizer.ts @@ -28,7 +28,7 @@ export class EntityRecognizer extends AdaptiveRecognizer { dialogContext: DialogContext, activity: Partial, _telemetryProperties?: Record, - _telemetryMetrics?: Record + _telemetryMetrics?: Record, ): Promise { // Identify matched intents const text = activity.text ?? ''; @@ -56,7 +56,7 @@ export class EntityRecognizer extends AdaptiveRecognizer { dialogContext, dialogContext.context.activity.text, dialogContext.context.activity.locale, - entityPool + entityPool, ); entityPool.push(...newEntities); @@ -109,7 +109,7 @@ export class EntityRecognizer extends AdaptiveRecognizer { _dialogContext: DialogContext, _text: string, _locale: string, - _entities: Entity[] + _entities: Entity[], ): Promise { return []; } diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizerSet.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizerSet.ts index d04846d0ab..64f4889b83 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizerSet.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/entityRecognizerSet.ts @@ -30,7 +30,7 @@ export class EntityRecognizerSet extends Array { dialogContext: DialogContext, text: string, locale: string, - entities: Entity[] = [] + entities: Entity[] = [], ): Promise { const allNewEntities: Entity[] = []; let entitiesToProcess: Entity[] = [...entities]; @@ -53,14 +53,14 @@ export class EntityRecognizerSet extends Array { dialogContext, text, locale, - entitiesToProcess + entitiesToProcess, ); for (let j = 0; j < newEntities.length; j++) { const newEntity = newEntities[j]; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + if ( !allNewEntities.find( - (entity) => !newEntity && JSON.stringify(entity) == JSON.stringify(newEntity) + (entity) => !newEntity && JSON.stringify(entity) == JSON.stringify(newEntity), ) ) { allNewEntities.push(newEntity); diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/textEntityRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/textEntityRecognizer.ts index a4276033ab..21f0fe63e0 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/textEntityRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/entityRecognizers/textEntityRecognizer.ts @@ -29,17 +29,15 @@ export abstract class TextEntityRecognizer extends EntityRecognizer { dialogContext: DialogContext, text: string, locale: string, - entities: Entity[] + entities: Entity[], ): Promise { const culture = Culture.mapToNearestLanguage(locale ?? ''); return entities .filter((e: Entity): boolean => e.type == 'text') - .map( - (e: Entity): TextEntity => { - const textEntity = new TextEntity(); - return Object.assign(textEntity, e); - } - ) + .map((e: Entity): TextEntity => { + const textEntity = new TextEntity(); + return Object.assign(textEntity, e); + }) .reduce((entities: Entity[], textEntity: TextEntity) => { return entities.concat( this._recognize(textEntity.text, culture).map((result: ModelResult) => { @@ -47,14 +45,14 @@ export abstract class TextEntityRecognizer extends EntityRecognizer { { type: result.typeName, }, - result + result, ); delete newEntity.typeName; // The text recognizer libraries return models with End => array inclusive endIndex. // We want end to be (end-start) = length, length = endIndex - startIndex. newEntity.end += 1; return newEntity; - }) + }), ); }, []); } diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/multiLanguageRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/multiLanguageRecognizer.ts index 3c7c746239..290386a9d8 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/multiLanguageRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/multiLanguageRecognizer.ts @@ -57,7 +57,7 @@ export class MultiLanguageRecognizer extends AdaptiveRecognizer implements Multi dialogContext: DialogContext, activity: Activity, telemetryProperties?: { [key: string]: string }, - telemetryMetrics?: { [key: string]: number } + telemetryMetrics?: { [key: string]: number }, ): Promise { let languagepolicy: LanguagePolicy = this.languagePolicy; if (!languagepolicy) { @@ -91,13 +91,13 @@ export class MultiLanguageRecognizer extends AdaptiveRecognizer implements Multi dialogContext, activity, telemetryProperties, - telemetryMetrics + telemetryMetrics, ); this.trackRecognizerResult( dialogContext, TelemetryLoggerConstants.MultiLanguageRecognizerResultEvent, this.fillRecognizerResultTelemetryProperties(result, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return result; } @@ -112,7 +112,7 @@ export class MultiLanguageRecognizer extends AdaptiveRecognizer implements Multi dialogContext, TelemetryLoggerConstants.MultiLanguageRecognizerResultEvent, this.fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return recognizerResult; diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/recognizerSet.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/recognizerSet.ts index 37f46e4791..11574b0c10 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/recognizerSet.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/recognizerSet.ts @@ -50,14 +50,12 @@ export class RecognizerSet extends AdaptiveRecognizer implements RecognizerSetCo dialogContext: DialogContext, activity: Activity, telemetryProperties?: { [key: string]: string }, - telemetryMetrics?: { [key: string]: number } + telemetryMetrics?: { [key: string]: number }, ): Promise { const results = await Promise.all( - this.recognizers.map( - (recognizer: Recognizer): Promise => { - return recognizer.recognize(dialogContext, activity, telemetryProperties, telemetryMetrics); - } - ) + this.recognizers.map((recognizer: Recognizer): Promise => { + return recognizer.recognize(dialogContext, activity, telemetryProperties, telemetryMetrics); + }), ); const recognizerResult: RecognizerResult = this.mergeResults(results); @@ -66,7 +64,7 @@ export class RecognizerSet extends AdaptiveRecognizer implements RecognizerSetCo dialogContext, TelemetryLoggerConstants.RecognizerSetResultEvent, this.fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return recognizerResult; @@ -118,9 +116,8 @@ export class RecognizerSet extends AdaptiveRecognizer implements RecognizerSetCo for (const [propertyName, propertyVal] of Object.entries(result.entities)) { if (propertyName === '$instance') { for (const [entityName, entityValue] of Object.entries(propertyVal)) { - const mergedInstanceEntities = (mergedRecognizerResult.entities['$instance'][ - entityName - ] ??= []); + const mergedInstanceEntities = (mergedRecognizerResult.entities['$instance'][entityName] ??= + []); mergedInstanceEntities.push(...entityValue); } } else { diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/regexRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/regexRecognizer.ts index d5f95ed071..184091f972 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/regexRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/regexRecognizer.ts @@ -75,7 +75,7 @@ export class RegexRecognizer extends AdaptiveRecognizer implements RegexRecogniz dialogContext: DialogContext, activity: Activity, telemetryProperties?: { [key: string]: string }, - telemetryMetrics?: { [key: string]: number } + telemetryMetrics?: { [key: string]: number }, ): Promise { const text = activity.text ?? ''; const locale = activity.locale ?? Culture.English; @@ -176,13 +176,13 @@ export class RegexRecognizer extends AdaptiveRecognizer implements RegexRecogniz 'RegexRecognizer', recognizerResult, 'RecognizerResult', - 'Regex RecognizerResult' + 'Regex RecognizerResult', ); this.trackRecognizerResult( dialogContext, TelemetryLoggerConstants.RegexRecognizerResultEvent, this.fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return recognizerResult; } diff --git a/libraries/botbuilder-dialogs-adaptive/src/recognizers/valueRecognizer.ts b/libraries/botbuilder-dialogs-adaptive/src/recognizers/valueRecognizer.ts index 63cdff515a..40c3cca12e 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/recognizers/valueRecognizer.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/recognizers/valueRecognizer.ts @@ -33,7 +33,7 @@ export class ValueRecognizer extends AdaptiveRecognizer { dialogContext: DialogContext, activity: Activity, telemetryProperties?: { [key: string]: string }, - telemetryMetrics?: { [key: string]: number } + telemetryMetrics?: { [key: string]: number }, ): Promise { const recognizerResult: RecognizerResult = { text: activity.text, @@ -60,7 +60,7 @@ export class ValueRecognizer extends AdaptiveRecognizer { dialogContext, TelemetryLoggerConstants.ValueRecognizerResultEvent, this.fillRecognizerResultTelemetryProperties(recognizerResult, telemetryProperties, dialogContext), - telemetryMetrics + telemetryMetrics, ); return recognizerResult; diff --git a/libraries/botbuilder-dialogs-adaptive/src/skillExtensions.ts b/libraries/botbuilder-dialogs-adaptive/src/skillExtensions.ts index 043f6c893d..95f97a4f9e 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/skillExtensions.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/skillExtensions.ts @@ -44,7 +44,7 @@ export class SkillExtensions { */ static useSkillConversationIdFactory( dialogManager: DialogManager, - skillConversationIdFactory: SkillConversationIdFactoryBase + skillConversationIdFactory: SkillConversationIdFactoryBase, ): DialogManager { dialogManager.initialTurnState.set(skillConversationIdFactoryKey, skillConversationIdFactory); return dialogManager; diff --git a/libraries/botbuilder-dialogs-adaptive/src/templates/activityTemplate.ts b/libraries/botbuilder-dialogs-adaptive/src/templates/activityTemplate.ts index ebe78f04af..54162241d9 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/templates/activityTemplate.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/templates/activityTemplate.ts @@ -28,7 +28,8 @@ export interface ActivityTemplateConguration { * and processed through registered language generator. */ export class ActivityTemplate - implements TemplateInterface, DialogStateManager>, ActivityTemplateConguration, Configurable { + implements TemplateInterface, DialogStateManager>, ActivityTemplateConguration, Configurable +{ static $kind = 'Microsoft.ActivityTemplate'; /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/templates/staticActivityTemplate.ts b/libraries/botbuilder-dialogs-adaptive/src/templates/staticActivityTemplate.ts index 5c22ae0c9c..f4973269c6 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/templates/staticActivityTemplate.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/templates/staticActivityTemplate.ts @@ -17,7 +17,8 @@ export interface StaticActivityTemplateConfiguration { * Defines a static activity as a template. */ export class StaticActivityTemplate - implements TemplateInterface, unknown>, StaticActivityTemplateConfiguration, Configurable { + implements TemplateInterface, unknown>, StaticActivityTemplateConfiguration, Configurable +{ static $kind = 'Microsoft.StaticActivityTemplate'; /** diff --git a/libraries/botbuilder-dialogs-adaptive/src/templates/textTemplate.ts b/libraries/botbuilder-dialogs-adaptive/src/templates/textTemplate.ts index 955d57cc79..0e7d745c68 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/templates/textTemplate.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/templates/textTemplate.ts @@ -20,7 +20,8 @@ export interface TextTemplateConfiguration { * and processed through registered language generator. */ export class TextTemplate> - implements TemplateInterface, TextTemplateConfiguration, Configurable { + implements TemplateInterface, TextTemplateConfiguration, Configurable +{ static $kind = 'Microsoft.TextTemplate'; /** diff --git a/libraries/botbuilder-dialogs-adaptive/tests/LGGenerator.test.js b/libraries/botbuilder-dialogs-adaptive/tests/LGGenerator.test.js index c30e8edc7f..ef372289d8 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/LGGenerator.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/LGGenerator.test.js @@ -49,7 +49,7 @@ describe('LGLanguageGenerator', function () { assert.equal(resourceNames.length, 7); assert.deepStrictEqual( new Set(resourceNames), - new Set(['a.lg', 'b.lg', 'c.lg', 'NormalStructuredLG.lg', 'root.lg', 'subDialog.lg', 'test.lg']) + new Set(['a.lg', 'b.lg', 'c.lg', 'NormalStructuredLG.lg', 'root.lg', 'subDialog.lg', 'test.lg']), ); }); @@ -67,7 +67,7 @@ describe('LGLanguageGenerator', function () { 'NormalStructuredLG.lg', 'root.lg', 'subDialog.lg', - ]) + ]), ); }); @@ -85,7 +85,7 @@ describe('LGLanguageGenerator', function () { 'NormalStructuredLG.lg', 'root.lg', 'subDialog.lg', - ]) + ]), ); }); }); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/activityFactory.test.js b/libraries/botbuilder-dialogs-adaptive/tests/activityFactory.test.js index 141f395976..e4aa75cb4a 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/activityFactory.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/activityFactory.test.js @@ -38,7 +38,7 @@ describe('ActivityFactoryTest', function () { assert.strictEqual(result.attachments, undefined); assert.strictEqual( result.text.replace(/\r\n/g, '\n').replace(/\n/g, '').replace(/\s+/g, ''), - '{"lgType":"Acti","key":"value"}' + '{"lgType":"Acti","key":"value"}', ); }); @@ -567,7 +567,7 @@ function assertAdaptiveCardActivity(activity) { assert.strictEqual( activity.attachments[0].contentType, 'application/vnd.microsoft.card.adaptive', - 'attachment type should be adaptivecard' + 'attachment type should be adaptivecard', ); assert.strictEqual(activity.attachments[0].content.body[0].text, 'test', 'text of first body should have value'); } @@ -603,7 +603,7 @@ function assertAnimationCardActivity(activity) { assert.strictEqual(card.autostart, true); assert.strictEqual( card.image.url, - 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png' + 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png', ); assert.strictEqual(card.media[0].url, 'http://oi42.tinypic.com/1rchlx.jpg'); } @@ -627,7 +627,7 @@ function assertReceiptCardActivity(activity) { assert.strictEqual(button.value, 'https://azure.microsoft.com/en-us/pricing/'); assert.strictEqual( button.image, - 'https://account.windowsazure.com/content/6.10.1.38-.8225.160809-1618/aux-pre/images/offer-icon-freetrial.png' + 'https://account.windowsazure.com/content/6.10.1.38-.8225.160809-1618/aux-pre/images/offer-icon-freetrial.png', ); const facts = card.facts; @@ -642,14 +642,14 @@ function assertReceiptCardActivity(activity) { assert.strictEqual(items[0].title, 'Data Transfer'); assert.strictEqual( items[0].image.url, - 'https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png' + 'https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png', ); assert.strictEqual(items[0].price, '$ 38.45'); assert.strictEqual(items[0].quantity, '368'); assert.strictEqual(items[1].title, 'App Service'); assert.strictEqual( items[1].image.url, - 'https://github.com/amido/azure-vector-icons/raw/master/renders/cloud-service.png' + 'https://github.com/amido/azure-vector-icons/raw/master/renders/cloud-service.png', ); assert.strictEqual(items[1].price, '$ 45.00'); assert.strictEqual(items[1].quantity, '720'); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/beginSkill.test.js b/libraries/botbuilder-dialogs-adaptive/tests/beginSkill.test.js index 009a93efa5..f35b5e2605 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/beginSkill.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/beginSkill.test.js @@ -174,7 +174,7 @@ function createSkillClientAndStub(captureAction, returnStatusCode = StatusCodes. if (captureAction && typeof captureAction !== 'function') { throw new TypeError( - `Failed test arrangement - createSkillClientAndStub() received ${typeof captureAction} instead of undefined or a function.` + `Failed test arrangement - createSkillClientAndStub() received ${typeof captureAction} instead of undefined or a function.`, ); } diff --git a/libraries/botbuilder-dialogs-adaptive/tests/choiceSet.test.ts b/libraries/botbuilder-dialogs-adaptive/tests/choiceSet.test.ts index 340f95bec2..3914b47153 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/choiceSet.test.ts +++ b/libraries/botbuilder-dialogs-adaptive/tests/choiceSet.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ import 'mocha'; import { ObjectExpression } from 'adaptive-expressions'; import * as assert from 'assert'; @@ -30,7 +29,7 @@ describe('ChoiceSetTests', function () { it('TestValue', async function () { const state = {}; const ep = new ObjectExpression( - new ChoiceSet([{ value: 'test1' }, { value: 'test2' }, { value: 'test3' }]) + new ChoiceSet([{ value: 'test1' }, { value: 'test2' }, { value: 'test3' }]), ); const { value } = ep.tryGetValue(state); assertValues(value); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/conditionals.test.js b/libraries/botbuilder-dialogs-adaptive/tests/conditionals.test.js index 896cc57dd9..724565e143 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/conditionals.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/conditionals.test.js @@ -79,105 +79,105 @@ describe('ConditionalsTests', function () { it('OnCondition with condition', function () { assertExpression( new OnActivity('event', [], 'turn.test == 1'), - "((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnAssignEntity('property', 'entity', 'operation', [], 'turn.test == 1'), - "(((turn.dialogEvent.name == 'assignEntity') && (turn.test == 1)) && (turn.dialogEvent.value.property == 'property') && (turn.dialogEvent.value.value.name == 'entity') && (turn.dialogEvent.value.operation == 'operation'))" + "(((turn.dialogEvent.name == 'assignEntity') && (turn.test == 1)) && (turn.dialogEvent.value.property == 'property') && (turn.dialogEvent.value.value.name == 'entity') && (turn.dialogEvent.value.operation == 'operation'))", ); assertExpression( new OnBeginDialog([], 'turn.test == 1'), - "((turn.dialogEvent.name == 'beginDialog') && (turn.test == 1))" + "((turn.dialogEvent.name == 'beginDialog') && (turn.test == 1))", ); assertExpression( new OnCancelDialog([], 'turn.test == 1'), - "((turn.dialogEvent.name == 'cancelDialog') && (turn.test == 1))" + "((turn.dialogEvent.name == 'cancelDialog') && (turn.test == 1))", ); assertExpression( new OnChooseEntity('property', 'entity', 'Add()', [], 'turn.test == 1'), - "(((turn.dialogEvent.name == 'chooseEntity') && (turn.test == 1)) && (turn.dialogEvent.value.property == 'property') && (turn.dialogEvent.value.value.name == 'entity') && (turn.dialogEvent.value.operation == 'Add()'))" + "(((turn.dialogEvent.name == 'chooseEntity') && (turn.test == 1)) && (turn.dialogEvent.value.property == 'property') && (turn.dialogEvent.value.value.name == 'entity') && (turn.dialogEvent.value.operation == 'Add()'))", ); assertExpression( new OnCommandActivity([], 'turn.test == 1'), - `((turn.activity.type == '${ActivityTypes.Command}') && ((turn.dialogEvent.name == '${AdaptiveEvents.activityReceived}') && (turn.test == 1)))` + `((turn.activity.type == '${ActivityTypes.Command}') && ((turn.dialogEvent.name == '${AdaptiveEvents.activityReceived}') && (turn.test == 1)))`, ); assertExpression( new OnCommandResultActivity([], 'turn.test == 1'), - `((turn.activity.type == '${ActivityTypes.CommandResult}') && ((turn.dialogEvent.name == '${AdaptiveEvents.activityReceived}') && (turn.test == 1)))` + `((turn.activity.type == '${ActivityTypes.CommandResult}') && ((turn.dialogEvent.name == '${AdaptiveEvents.activityReceived}') && (turn.test == 1)))`, ); assertExpression(new OnCondition('turn.test == 1'), '(turn.test == 1)'); assertExpression( new OnContinueConversation([], 'turn.test == 1'), - "((turn.activity.name == 'ContinueConversation') && ((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1))))" + "((turn.activity.name == 'ContinueConversation') && ((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1))))", ); assertExpression( new OnConversationUpdateActivity([], 'turn.test == 1'), - "((turn.activity.type == 'conversationUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'conversationUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnDialogEvent('DialogEvent', [], 'turn.test == 1'), - "((turn.dialogEvent.name == 'DialogEvent') && (turn.test == 1))" + "((turn.dialogEvent.name == 'DialogEvent') && (turn.test == 1))", ); assertExpression( new OnEndOfActions([], 'turn.test == 1'), - "((turn.dialogEvent.name == 'endOfActions') && (turn.test == 1))" + "((turn.dialogEvent.name == 'endOfActions') && (turn.test == 1))", ); assertExpression( new OnEndOfConversationActivity([], 'turn.test == 1'), - "((turn.activity.type == 'endOfConversation') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'endOfConversation') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression(new OnError([], 'turn.test == 1'), "((turn.dialogEvent.name == 'error') && (turn.test == 1))"); assertExpression( new OnEventActivity([], 'turn.test == 1'), - "((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'event') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnHandoffActivity([], 'turn.test == 1'), - "((turn.activity.type == 'handoff') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'handoff') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnInstallationUpdateActivity([], 'turn.test == 1'), - "((turn.activity.type == 'installationUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'installationUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnIntent('Intent', ['@foo', '@@bar', 'turn.recognized.entities.blat', 'gronk'], [], 'turn.test == 1'), - "(((turn.recognized.intent == 'Intent') && (exists(@foo) && exists(@@bar) && exists(turn.recognized.entities.blat) && exists(@gronk))) && ((turn.dialogEvent.name == 'recognizedIntent') && (turn.test == 1)))" + "(((turn.recognized.intent == 'Intent') && (exists(@foo) && exists(@@bar) && exists(turn.recognized.entities.blat) && exists(@gronk))) && ((turn.dialogEvent.name == 'recognizedIntent') && (turn.test == 1)))", ); assertExpression( new OnInvokeActivity([], 'turn.test == 1'), - "((turn.activity.type == 'invoke') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'invoke') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnMessageActivity([], 'turn.test == 1'), - "((turn.activity.type == 'message') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'message') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnMessageDeleteActivity([], 'turn.test == 1'), - "((turn.activity.type == 'messageDelete') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'messageDelete') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnMessageReactionActivity([], 'turn.test == 1'), - "((turn.activity.type == 'messageReaction') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'messageReaction') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnMessageUpdateActivity([], 'turn.test == 1'), - "((turn.activity.type == 'messageUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'messageUpdate') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnQnAMatch([], 'turn.test == 1'), - "((turn.recognized.intent == 'QnAMatch') && ((turn.dialogEvent.name == 'recognizedIntent') && (turn.test == 1)))" + "((turn.recognized.intent == 'QnAMatch') && ((turn.dialogEvent.name == 'recognizedIntent') && (turn.test == 1)))", ); assertExpression( new OnRepromptDialog([], 'turn.test == 1'), - "((turn.dialogEvent.name == 'repromptDialog') && (turn.test == 1))" + "((turn.dialogEvent.name == 'repromptDialog') && (turn.test == 1))", ); assertExpression( new OnTypingActivity([], 'turn.test == 1'), - "((turn.activity.type == 'typing') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))" + "((turn.activity.type == 'typing') && ((turn.dialogEvent.name == 'activityReceived') && (turn.test == 1)))", ); assertExpression( new OnUnknownIntent([], 'turn.test == 1'), - "((turn.dialogEvent.name == 'unknownIntent') && (turn.test == 1))" + "((turn.dialogEvent.name == 'unknownIntent') && (turn.test == 1))", ); }); }); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/conversationAction.test.js b/libraries/botbuilder-dialogs-adaptive/tests/conversationAction.test.js index c21090fc52..abd82fb360 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/conversationAction.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/conversationAction.test.js @@ -69,7 +69,7 @@ describe('ConversationAction', function () { new ContinueConversationLater().configure({ date: '=addSeconds(utcNow(), 2)', value: 'foo', - }) + }), ); dm.initialTurnState.set(DialogTurnStateConstants.queueStorage, queueStorage); @@ -118,7 +118,7 @@ describe('ConversationAction', function () { ], }), ], - }) + }), ); dm.initialTurnState.set(DialogTurnStateConstants.queueStorage, queueStorage); const adapter = new TestAdapter((turnContext) => { @@ -176,7 +176,7 @@ describe('ConversationAction', function () { ], }), ], - }) + }), ); dm.initialTurnState.set(DialogTurnStateConstants.queueStorage, queueStorage); const adapter = new TestAdapter((turnContext) => { diff --git a/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizer.test.js b/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizer.test.js index f89a4c1935..aa09944b71 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizer.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizer.test.js @@ -40,7 +40,7 @@ const getDialogContext = (testName, text, locale = 'en-us') => { from: bot, locale, }), - {} + {}, ); }; @@ -69,7 +69,7 @@ describe('EntityRecognizer Tests', function () { new RegexEntityRecognizer().configure({ name: 'size', pattern: '(?i)(small|medium|large)', - }) + }), ); it('test age', async function () { diff --git a/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizerRecognizer.test.js b/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizerRecognizer.test.js index b7f9da3ef0..d427d10351 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizerRecognizer.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/entityRecognizerRecognizer.test.js @@ -44,7 +44,7 @@ const getDialogContext = (testName, text, locale = 'en-us') => { from: bot, locale, }), - {} + {}, ); }; diff --git a/libraries/botbuilder-dialogs-adaptive/tests/expressionProperty.test.ts b/libraries/botbuilder-dialogs-adaptive/tests/expressionProperty.test.ts index fea3edc696..9182bc9784 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/expressionProperty.test.ts +++ b/libraries/botbuilder-dialogs-adaptive/tests/expressionProperty.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ import * as assert from 'assert'; import { DialogExpression, AdaptiveDialog } from '../'; diff --git a/libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js b/libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js index aff5bbb01e..562496311c 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js @@ -8,7 +8,7 @@ describe('LanguageGeneratorConverter', function () { const newGenerator = converter.convert(''); ok( newGenerator instanceof ResourceMultiLanguageGenerator, - 'expected newGenerator to be instance of ResourceMultiLanguageGenerator' + 'expected newGenerator to be instance of ResourceMultiLanguageGenerator', ); }); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/memory_memoryScopes.test.js b/libraries/botbuilder-dialogs-adaptive/tests/memory_memoryScopes.test.js index aad46de13c..a71be14d2e 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/memory_memoryScopes.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/memory_memoryScopes.test.js @@ -28,7 +28,7 @@ describe('Memory - Memory Scopes', function () { new SendActivity("${contains(dialogcontext.stack, 'foo')}"), new SendActivity("${contains(dialogcontext.stack, 'adaptiveDialog')}"), new SendActivity("${contains(dialogcontext.stack, 'adaptiveDialog2')}"), - ]) + ]), ); const storage = new MemoryStorage(); @@ -67,15 +67,15 @@ describe('Memory - Memory Scopes', function () { id: 'askForName', }), new SendActivity('I have ${user.name}'), - ]) + ]), ); root.triggers.push( new OnIntent( 'why', [], [new SendActivity('I need your name to complete the sample')], - "contains(dialogcontext.stack, 'askForName')" - ) + "contains(dialogcontext.stack, 'askForName')", + ), ); root.triggers.push(new OnIntent('why', [], [new SendActivity('why what?')])); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/regexRecognizer.test.js b/libraries/botbuilder-dialogs-adaptive/tests/regexRecognizer.test.js index f7ac69a9e0..23fc315a08 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/regexRecognizer.test.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/regexRecognizer.test.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const assert = require('assert'); const { Recognizer } = require('botbuilder-dialogs'); const { @@ -59,7 +58,7 @@ describe('RegexRecognizer Tests', function () { new UrlEntityRecognizer(), new RegexEntityRecognizer('color', '(red|green|blue|purple|orange|violet|white|black)'), new RegexEntityRecognizer('backgroundColor', '(back|background) {color}'), - new RegexEntityRecognizer('foregroundColor', '(foreground|front) {color}') + new RegexEntityRecognizer('foregroundColor', '(foreground|front) {color}'), ), }); @@ -177,7 +176,7 @@ describe('RegexRecognizer Tests', function () { new OrdinalEntityRecognizer(), new RegexEntityRecognizer('color', '(red|green|blue|purple|orange|violet|white|black)'), new RegexEntityRecognizer('backgroundColor', '(back|background) {color}'), - new RegexEntityRecognizer('foregroundColor', '(foreground|front) {color}') + new RegexEntityRecognizer('foregroundColor', '(foreground|front) {color}'), ), }); const trackEventSpy = spyOnTelemetryClientTrackEvent(recognizerWithDefaultLogPii); @@ -263,7 +262,7 @@ describe('RegexRecognizer Tests', function () { it('recognize dimension', async function () { const dc = createContext(''); const activity = createMessageActivity( - 'The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours.' + 'The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours.', ); const result = await recognizer.recognize(dc, activity); const entities = result.entities; @@ -450,7 +449,7 @@ describe('RegexRecognizer Tests', function () { }; const properties = recognizer.fillRecognizerResultTelemetryProperties( recognizerResultSample, - telemetryProperties + telemetryProperties, ); assert('Text' in properties); assert.strictEqual(properties['Text'], recognizerResultSample['text']); diff --git a/libraries/botbuilder-dialogs-adaptive/tests/telemetryUtils.js b/libraries/botbuilder-dialogs-adaptive/tests/telemetryUtils.js index ce85187f81..61e180cc82 100644 --- a/libraries/botbuilder-dialogs-adaptive/tests/telemetryUtils.js +++ b/libraries/botbuilder-dialogs-adaptive/tests/telemetryUtils.js @@ -9,7 +9,7 @@ const { NullTelemetryClient } = require('botbuilder'); function createTelemetryClientAndStub(captureTelemetryAction) { if (captureTelemetryAction && typeof captureTelemetryAction !== 'function') { throw new TypeError( - `Failed test arrangement - createtelemetryClientAndStub() received ${typeof captureTelemetryAction} instead of undefined or a function.` + `Failed test arrangement - createtelemetryClientAndStub() received ${typeof captureTelemetryAction} instead of undefined or a function.`, ); } From e25a5f225c12c67775eed0ae11a52a200407ee20 Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Wed, 23 Oct 2024 15:25:16 -0300 Subject: [PATCH 2/2] Remove unnecessary empty line --- libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts index cfe0050c0f..c1bf767392 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts @@ -9,7 +9,6 @@ import { StatusCodes } from 'botbuilder-core'; import fetch, { FetchError, Response, Headers } from 'node-fetch'; import { Activity } from 'botbuilder'; import { BoolProperty, EnumProperty, StringProperty, UnknownProperty } from '../properties'; - import { evaluateExpression } from '../jsonExtensions'; import {