diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/eslint.config.cjs b/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/eslint.config.cjs deleted file mode 100644 index 63647b52cc..0000000000 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/eslint.config.cjs +++ /dev/null @@ -1,10 +0,0 @@ -const onlyWarn = require("eslint-plugin-only-warn"); -const sharedConfig = require("../../eslint.config.cjs") - -module.exports = [ - ...sharedConfig, - { - plugins: { - "only-warn": onlyWarn, - }, - }]; diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/package.json b/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/package.json index 1ced92a8a9..82cf805d95 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/package.json +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/package.json @@ -32,7 +32,6 @@ "botbuilder": "4.1.6", "botbuilder-dialogs-adaptive-runtime": "4.1.6", "botbuilder-dialogs-adaptive-runtime-core": "4.1.6", - "eslint-plugin-only-warn": "^1.1.0", "mime": "^4.0.4", "zod": "^3.23.8" }, @@ -40,7 +39,7 @@ "build": "tsc -b", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", "depcheck": "depcheck --config ../../.depcheckrc", - "lint": "eslint .", + "lint": "eslint . --config ../../eslint.config.cjs", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum" }, "files": [ diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/src/index.ts b/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/src/index.ts index e41edc65bf..286700753b 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/src/index.ts +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-azure-functions/src/index.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/* eslint-disable @typescript-eslint/no-explicit-any */ - import * as z from 'zod'; import fs from 'fs'; import mime from 'mime'; @@ -62,7 +60,7 @@ const extensionContentTypes: Record = { export function makeTriggers( runtimeServices: () => Promise<[ServiceCollection, Configuration]>, applicationRoot: string, - options: Partial = {} + options: Partial = {}, ): Record { const resolvedOptions = TypedOptions.parse(Object.assign({}, defaultOptions, options)); @@ -106,8 +104,8 @@ export function makeTriggers( name: z.string(), enabled: z.boolean().optional(), route: z.string(), - }) - ) + }), + ), ) ?? []; const adapterSetting = adapterSettings @@ -137,7 +135,7 @@ export function makeTriggers( res, async (turnContext) => { await bot.run(turnContext); - } + }, ); } catch (err) { if (resolvedOptions.logErrors) { @@ -167,7 +165,7 @@ export function makeTriggers( authHeader, conversationId, activityId, - activity + activity, ); const res = context.res as Response; @@ -202,8 +200,8 @@ export function makeTriggers( const contents = await new Promise((resolve, reject) => // eslint-disable-next-line security/detect-non-literal-fs-filename fs.readFile(path.join(staticDirectory, filePath), 'utf8', (err, contents) => - err ? reject(err) : resolve(contents) - ) + err ? reject(err) : resolve(contents), + ), ); res.status(200); @@ -235,11 +233,11 @@ export function makeTriggers( export function triggers( applicationRoot: string, settingsDirectory: string, - options: Partial = {} + options: Partial = {}, ): Record { return makeTriggers( memoize(() => getRuntimeServices(applicationRoot, settingsDirectory)), applicationRoot, - options + options, ); } diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/eslint.config.cjs b/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/eslint.config.cjs deleted file mode 100644 index 63647b52cc..0000000000 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/eslint.config.cjs +++ /dev/null @@ -1,10 +0,0 @@ -const onlyWarn = require("eslint-plugin-only-warn"); -const sharedConfig = require("../../eslint.config.cjs") - -module.exports = [ - ...sharedConfig, - { - plugins: { - "only-warn": onlyWarn, - }, - }]; diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/package.json b/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/package.json index 13eb04cf32..1d60891c2b 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/package.json +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/package.json @@ -28,7 +28,7 @@ "build": "tsc -b", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", "depcheck": "depcheck --config ../../.depcheckrc", - "lint": "eslint .", + "lint": "eslint . --config ../../eslint.config.cjs", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum" }, "files": [ @@ -44,7 +44,6 @@ "botbuilder-dialogs-adaptive-runtime-core": "4.1.6", "botframework-connector": "4.1.6", "express": "^4.21.0", - "eslint-plugin-only-warn": "^1.1.0", "zod": "^3.23.8" } } diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/src/index.ts b/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/src/index.ts index e9560c934d..26005cf656 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/src/index.ts +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-express/src/index.ts @@ -43,7 +43,7 @@ const TypedOptions = z.object({ /** * Used when creating ConnectorClients. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + connectorClientOptions: z.object({}) as z.ZodObject, }); @@ -71,7 +71,7 @@ const defaultOptions: Options = { export async function start( applicationRoot: string, settingsDirectory: string, - options: Partial = {} + options: Partial = {}, ): Promise { const [services, configuration] = await getRuntimeServices(applicationRoot, settingsDirectory, { connectorClientOptions: options.connectorClientOptions, @@ -102,7 +102,7 @@ export async function makeApp( configuration: Configuration, applicationRoot: string, options: Partial = {}, - app: Application = express() + app: Application = express(), ): Promise<[Application, (callback?: () => void) => Server]> { const configOverrides: Partial = {}; @@ -119,11 +119,10 @@ export async function makeApp( } if (res && !res.headersSent) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const statusCode = typeof (err as any)?.statusCode === 'number' ? (err as any).statusCode : 500; res.status(statusCode).json({ - message: err instanceof Error ? err.message : err ?? 'Internal server error', + message: err instanceof Error ? err.message : (err ?? 'Internal server error'), }); } }; @@ -146,7 +145,7 @@ export async function makeApp( res.setHeader('Content-Type', contentType); } }, - }) + }), ); app.post(resolvedOptions.messagingEndpointPath, async (req, res) => { @@ -169,8 +168,8 @@ export async function makeApp( name: z.string(), enabled: z.boolean().optional(), route: z.string(), - }) - ) + }), + ), ) ?? []; adapters @@ -200,7 +199,7 @@ export async function makeApp( // after the app starts listening for requests. const server = app.listen( resolvedOptions.port, - callback ?? (() => console.log(`server listening on port ${resolvedOptions.port}`)) + callback ?? (() => console.log(`server listening on port ${resolvedOptions.port}`)), ); server.on('upgrade', async (req, socket, head) => { diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/eslint.config.cjs b/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/eslint.config.cjs deleted file mode 100644 index 63647b52cc..0000000000 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/eslint.config.cjs +++ /dev/null @@ -1,10 +0,0 @@ -const onlyWarn = require("eslint-plugin-only-warn"); -const sharedConfig = require("../../eslint.config.cjs") - -module.exports = [ - ...sharedConfig, - { - plugins: { - "only-warn": onlyWarn, - }, - }]; diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/package.json b/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/package.json index 9453486b69..2ea1dfd202 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/package.json +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/package.json @@ -31,7 +31,6 @@ "botbuilder": "4.1.6", "botbuilder-dialogs-adaptive-runtime": "4.1.6", "botbuilder-dialogs-adaptive-runtime-core": "4.1.6", - "eslint-plugin-only-warn": "^1.1.0", "restify": "^11.1.0", "zod": "^3.23.8" }, @@ -39,7 +38,7 @@ "build": "tsc -b", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", "depcheck": "depcheck --config ../../.depcheckrc", - "lint": "eslint .", + "lint": "eslint . --config ../../eslint.config.cjs", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum" }, "files": [ diff --git a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/src/index.ts b/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/src/index.ts index b9fddd2ddb..e59836fae5 100644 --- a/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/src/index.ts +++ b/libraries/botbuilder-dialogs-adaptive-runtime-integration-restify/src/index.ts @@ -72,7 +72,7 @@ async function resolveOptions(options: Partial, configuration: Configur export async function start( applicationRoot: string, settingsDirectory: string, - options: Partial = {} + options: Partial = {}, ): Promise { const [services, configuration] = await getRuntimeServices(applicationRoot, settingsDirectory); @@ -104,7 +104,7 @@ export async function makeServer( configuration: Configuration, applicationRoot: string, options: Partial = {}, - server = restify.createServer() + server = restify.createServer(), ): Promise { server.use(restify.plugins.acceptParser(server.acceptable)); server.use(restify.plugins.queryParser()); @@ -125,12 +125,11 @@ export async function makeServer( } if (res && !res.headersSent) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const statusCode = typeof (err as any)?.statusCode === 'number' ? (err as any).statusCode : 500; res.status(statusCode); res.json({ - message: err instanceof Error ? err.message : err ?? 'Internal server error', + message: err instanceof Error ? err.message : (err ?? 'Internal server error'), }); } }; @@ -155,8 +154,8 @@ export async function makeServer( name: z.string(), enabled: z.boolean().optional(), route: z.string(), - }) - ) + }), + ), ) ?? []; adapters @@ -187,7 +186,7 @@ export async function makeServer( res.setHeader('Content-Type', contentType); } }, - }) + }), ); server.on('upgrade', async (req, socket, head) => {