diff --git a/libraries/botframework-config/eslint.config.cjs b/libraries/botframework-config/eslint.config.cjs deleted file mode 100644 index 63647b52cc..0000000000 --- a/libraries/botframework-config/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/botframework-config/package.json b/libraries/botframework-config/package.json index e747074b11..fa3eb0ee3b 100644 --- a/libraries/botframework-config/package.json +++ b/libraries/botframework-config/package.json @@ -34,7 +34,6 @@ "url": "git@github.com:Microsoft/botbuilder-js.git" }, "dependencies": { - "eslint-plugin-only-warn": "^1.1.0", "fs-extra": "^11.2.0", "uuid": "^10.0.0" }, @@ -45,7 +44,7 @@ "build": "tsc -b", "build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", - "lint": "eslint .", + "lint": "eslint . --config ../../eslint.config.cjs", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum", "test": "yarn build && nyc mocha tests/", "test:compat": "api-extractor run --verbose" diff --git a/libraries/botframework-config/src/botConfiguration.ts b/libraries/botframework-config/src/botConfiguration.ts index a39ee7fad5..65c907c852 100644 --- a/libraries/botframework-config/src/botConfiguration.ts +++ b/libraries/botframework-config/src/botConfiguration.ts @@ -71,7 +71,7 @@ export class BotConfiguration extends BotConfigurationBase { } } throw new Error( - `Error: no bot file found in ${folder}. Choose a different location or use msbot init to create a .bot file."` + `Error: no bot file found in ${folder}. Choose a different location or use msbot init to create a .bot file."`, ); } @@ -94,7 +94,7 @@ export class BotConfiguration extends BotConfigurationBase { } } throw new Error( - `Error: no bot file found in ${folder}. Choose a different location or use msbot init to create a .bot file."` + `Error: no bot file found in ${folder}. Choose a different location or use msbot init to create a .bot file."`, ); } @@ -330,7 +330,7 @@ export class BotConfiguration extends BotConfigurationBase { validateSecret(secret: string): void { if (!secret) { throw new Error( - 'You are attempting to perform an operation which needs access to the secret and --secret is missing' + 'You are attempting to perform an operation which needs access to the secret and --secret is missing', ); } @@ -344,7 +344,7 @@ export class BotConfiguration extends BotConfigurationBase { } } catch { throw new Error( - 'You are attempting to perform an operation which needs access to the secret and --secret is incorrect.' + 'You are attempting to perform an operation which needs access to the secret and --secret is incorrect.', ); } } diff --git a/libraries/botframework-config/src/models/connectedService.ts b/libraries/botframework-config/src/models/connectedService.ts index 81db2581de..415d0908be 100644 --- a/libraries/botframework-config/src/models/connectedService.ts +++ b/libraries/botframework-config/src/models/connectedService.ts @@ -28,7 +28,10 @@ export class ConnectedService implements IConnectedService { * @param source (Optional) JSON based service definition. * @param type (Optional) type of service being defined. */ - constructor(source: IConnectedService = {} as IConnectedService, public type?: ServiceTypes) { + constructor( + source: IConnectedService = {} as IConnectedService, + public type?: ServiceTypes, + ) { Object.assign(this, source); if (type) { this.type = type; diff --git a/libraries/botframework-config/tests/botRecipe.test.js b/libraries/botframework-config/tests/botRecipe.test.js index ee1cf3ff06..43e134b2f8 100644 --- a/libraries/botframework-config/tests/botRecipe.test.js +++ b/libraries/botframework-config/tests/botRecipe.test.js @@ -6,21 +6,22 @@ const { BotRecipe } = require('../lib'); function assertService(newService, oldService) { assert( newService.type === oldService.type, - `newService.type [${newService.type}] !== oldService.type [${oldService.type}]` + `newService.type [${newService.type}] !== oldService.type [${oldService.type}]`, ); assert(newService.id === oldService.id, `newService.id [${newService.id}] !== oldService.id [${oldService.id}]`); assert( newService.name === oldService.name, - `newService.name [${newService.name}] !== oldService.name [${oldService.name}]` + `newService.name [${newService.name}] !== oldService.name [${oldService.name}]`, ); assert( newService.url === oldService.url, - `newService.url [${newService.url}] !== oldService.url [${oldService.url}]` + `newService.url [${newService.url}] !== oldService.url [${oldService.url}]`, ); } describe('BotRecipe', function () { const recipe = new BotRecipe(); + it("should have a default version of '1.0'.", function () { assert(recipe.version === '1.0', `expected version '1.0', instead received ${recipe.version}`); }); @@ -28,7 +29,7 @@ describe('BotRecipe', function () { it('should have default resources be an empty array.', function () { assert( Array.isArray(recipe.resources), - `expected resources to be an Array, instead it is type "${typeof recipe.resources}"` + `expected resources to be an Array, instead it is type "${typeof recipe.resources}"`, ); assert(recipe.resources.length === 0, `initial resources should be length 0, not ${recipe.resources.length}`); }); @@ -45,15 +46,15 @@ describe('BotRecipe', function () { assert( newRecipe.version === oldVersion, - `expected version ${oldVersion}, instead received ${newRecipe.version}` + `expected version ${oldVersion}, instead received ${newRecipe.version}`, ); assert( Array.isArray(newRecipe.resources), - `expected resources to be an Array, instead it is type "${typeof newRecipe.resources}"` + `expected resources to be an Array, instead it is type "${typeof newRecipe.resources}"`, ); assert( newRecipe.resources.length === oldResources.length, - `initial resources should be length ${oldResources.length}, not ${newRecipe.resources.length}` + `initial resources should be length ${oldResources.length}, not ${newRecipe.resources.length}`, ); assertService(newRecipe.resources[0], oldEndpoint); }); diff --git a/libraries/botframework-config/tests/encryption.test.js b/libraries/botframework-config/tests/encryption.test.js index ca942beb2f..794e2ffc5d 100644 --- a/libraries/botframework-config/tests/encryption.test.js +++ b/libraries/botframework-config/tests/encryption.test.js @@ -65,7 +65,7 @@ describe('EncryptionTests', function () { assert.throws( () => encrypt.decryptString(encrypted, encrypt.generateKey()), - new Error('error:1C800064:Provider routines::bad decrypt') + new Error('error:1C800064:Provider routines::bad decrypt'), ); }); }); diff --git a/libraries/botframework-config/tests/loadAndSave.test.js b/libraries/botframework-config/tests/loadAndSave.test.js index d7d83ffa66..37470efc4c 100644 --- a/libraries/botframework-config/tests/loadAndSave.test.js +++ b/libraries/botframework-config/tests/loadAndSave.test.js @@ -99,7 +99,7 @@ describe('LoadAndSaveTests', function () { await assert.rejects( bf.BotConfiguration.load(saveBotPath), new Error( - 'You are attempting to perform an operation which needs access to the secret and --secret is missing' + 'You are attempting to perform an operation which needs access to the secret and --secret is missing', ), ); } @@ -158,12 +158,12 @@ describe('LoadAndSaveTests', function () { const appInsights = config2.services[i]; assert.ok( appInsights.instrumentationKey.includes('0000000'), - 'failed to decrypt instrumentationKey' + 'failed to decrypt instrumentationKey', ); assert.equal( appInsights.applicationId, '00000000-0000-0000-0000-000000000007', - 'failed to decrypt applicationId' + 'failed to decrypt applicationId', ); assert.equal(appInsights.apiKeys.key1, 'testKey1', 'failed to decrypt key1'); assert.equal(appInsights.apiKeys.key2, 'testKey2', 'failed to decrypt key2'); @@ -175,7 +175,7 @@ describe('LoadAndSaveTests', function () { const storage = config2.services[i]; assert.ok( storage.connectionString.includes('UseDevelopmentStorage'), - 'failed to decrypt connectionString' + 'failed to decrypt connectionString', ); assert.equal(storage.container, 'testContainer', 'failed to decrypt container'); } @@ -188,7 +188,7 @@ describe('LoadAndSaveTests', function () { assert.equal( storage.key, 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==', - 'failed to decrypt key' + 'failed to decrypt key', ); assert.equal(storage.database, 'testDatabase', 'failed to decrypt database'); assert.equal(storage.collection, 'testCollection', 'failed to decrypt collection'); @@ -264,12 +264,12 @@ describe('LoadAndSaveTests', function () { const appInsights = config2.services[i]; assert.ok( !appInsights.instrumentationKey.includes('0000000'), - 'failed to encrypt instrumentationKey' + 'failed to encrypt instrumentationKey', ); assert.equal( appInsights.applicationId, '00000000-0000-0000-0000-000000000007', - 'should not encrypt applicationId' + 'should not encrypt applicationId', ); assert.notEqual(appInsights.apiKeys.key1, 'testKey1', 'failed to encrypt key1'); assert.notEqual(appInsights.apiKeys.key2, 'testKey2', 'failed to encrypt key2'); @@ -281,7 +281,7 @@ describe('LoadAndSaveTests', function () { const storage = config2.services[i]; assert.ok( !storage.connectionString.includes('UseDevelopmentStorage'), - 'failed to encrypt connectionString' + 'failed to encrypt connectionString', ); assert.equal(storage.container, 'testContainer', 'should not have encrypted container'); } @@ -294,7 +294,7 @@ describe('LoadAndSaveTests', function () { assert.notEqual( storage.key, 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==', - 'failed to encrypt key' + 'failed to encrypt key', ); assert.equal(storage.database, 'testDatabase', 'should not have encrypted database'); assert.equal(storage.collection, 'testCollection', 'should not have encrypted collection'); diff --git a/libraries/botframework-config/tests/service.test.js b/libraries/botframework-config/tests/service.test.js index be8fc199ca..ae63b1c749 100644 --- a/libraries/botframework-config/tests/service.test.js +++ b/libraries/botframework-config/tests/service.test.js @@ -33,7 +33,7 @@ describe('Service Tests', function () { }); assert.equal( qnaWithQnamakerHostname.hostname, - 'https://MyServiceThatDoesntNeedAppending.azurewebsites.net/qnamaker' + 'https://MyServiceThatDoesntNeedAppending.azurewebsites.net/qnamaker', ); });