Skip to content

Commit

Permalink
fix: ESLint issues in botbuilder (#4830)
Browse files Browse the repository at this point in the history
* fix eslint issues in botbuilder

* Merge branch 'southworks/update/eslint-packages' into southworks/fix/eslint-issues-botbuilder

* remove eslint-plugin-chai-friendly package

* remove eslint-plugin-only-warn

* cast authorization variable

* apply sub-bullet format

* apply missing format

* update yarn.lock
  • Loading branch information
JhontSouth authored Jan 6, 2025
1 parent 228ca6e commit a36641b
Show file tree
Hide file tree
Showing 52 changed files with 753 additions and 788 deletions.
1 change: 1 addition & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = [
'**/*.lu',
'**/*.dialog',
'**/*.js.map',
'**/vendors'
],
},

Expand Down
10 changes: 0 additions & 10 deletions libraries/botbuilder/eslint.config.cjs

This file was deleted.

5 changes: 2 additions & 3 deletions libraries/botbuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"botframework-schema": "4.1.6",
"botframework-streaming": "4.1.6",
"dayjs": "^1.11.13",
"eslint-plugin-only-warn": "^1.1.0",
"filenamify": "^6.0.0",
"fs-extra": "^11.2.0",
"htmlparser2": "^9.0.1",
Expand All @@ -55,7 +54,7 @@
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib vendors tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"prebuild": "tsup ./node_modules/filenamify/*.js --format cjs --dts --out-dir vendors/filenamify --clean --sourcemap",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "npm-run-all build test:mocha",
Expand All @@ -73,4 +72,4 @@
"src",
"vendors"
]
}
}
206 changes: 91 additions & 115 deletions libraries/botbuilder/src/botFrameworkAdapter.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions libraries/botbuilder/src/botFrameworkHttpAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface BotFrameworkHttpAdapter {
req: Request,
socket: INodeSocket,
head: INodeBuffer,
logic: (context: TurnContext) => Promise<void>
logic: (context: TurnContext) => Promise<void>,
): Promise<void>;

/**
Expand All @@ -35,6 +35,6 @@ export interface BotFrameworkHttpAdapter {
req: Request,
socket: INodeDuplex,
head: INodeBuffer,
logic: (context: TurnContext) => Promise<void>
logic: (context: TurnContext) => Promise<void>,
): Promise<void>;
}
5 changes: 2 additions & 3 deletions libraries/botbuilder/src/botFrameworkHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export class BotFrameworkHttpClient implements BotFrameworkClient {
toUrl: string,
serviceUrl: string,
conversationId: string,
activity: Activity
activity: Activity,
): Promise<InvokeResponse<T>> {
const appCredentials = await this.getAppCredentials(fromBotId, toBotId);
if (!appCredentials) {
throw new Error(
'BotFrameworkHttpClient.postActivity(): Unable to get appCredentials to connect to the skill'
'BotFrameworkHttpClient.postActivity(): Unable to get appCredentials to connect to the skill',
);
}

Expand Down Expand Up @@ -152,7 +152,6 @@ export class BotFrameworkHttpClient implements BotFrameworkClient {
*
* @param appId The application id.
* @param oAuthScope Optional. The OAuth scope.
*
* @returns The app credentials to be used to acquire tokens.
*/
protected async buildCredentials(appId: string, oAuthScope?: string): Promise<AppCredentials> {
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder/src/channelServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ChannelServiceHandler extends ChannelServiceHandlerBase {
constructor(
private readonly credentialProvider: ICredentialProvider,
private readonly authConfig: AuthenticationConfiguration,
protected readonly channelService = process.env[AuthenticationConstants.ChannelService]
protected readonly channelService = process.env[AuthenticationConstants.ChannelService],
) {
super();

Expand Down Expand Up @@ -62,7 +62,7 @@ export class ChannelServiceHandler extends ChannelServiceHandlerBase {
this.channelService,
'unknown',
undefined,
this.authConfig
this.authConfig,
);
}
}
Loading

0 comments on commit a36641b

Please sign in to comment.