Skip to content

Commit

Permalink
Fix issues in botbuilder-stdlib (#4814)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila authored Jan 6, 2025
1 parent 551267e commit df3b3f5
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 20 deletions.
10 changes: 0 additions & 10 deletions libraries/botbuilder-stdlib/eslint.config.cjs

This file was deleted.

5 changes: 1 addition & 4 deletions libraries/botbuilder-stdlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"bugs": {
"url": "https://github.com/Microsoft/botbuilder-js/issues"
},
"dependencies": {
"eslint-plugin-only-warn": "^1.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/botbuilder-js.git"
Expand All @@ -20,7 +17,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",
"test": "yarn build && nyc mocha --check-leaks tests"
},
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-stdlib/src/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
export async function retry<T>(
promise: (n: number) => Promise<T>,
maxRetries: number,
initialDelay = 500
initialDelay = 500,
): Promise<T | undefined> {
let delay = initialDelay,
n = 1,
Expand Down
4 changes: 1 addition & 3 deletions libraries/botbuilder-stdlib/src/stringify.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/* eslint-disable @typescript-eslint/no-explicit-any */

/**
* Encapsulates JSON.stringify function to detect and handle different types of errors (eg. Circular Structure).
*
Expand Down Expand Up @@ -64,7 +62,7 @@ export function stringify(value: any, replacer?: (key: string, value: any) => an
const value = stringifyReplacer(replacer)(key, val);
return value;
},
space
space,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-stdlib/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export type Maybe<T> = T | Nil;
export type Newable<T, A extends unknown[] = unknown[]> = new (...args: A) => T;

// Extends<T> mimics Newable<T>, but works for abstract classes as well
export type Extends<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/ban-types
export type Extends<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type
1 change: 1 addition & 0 deletions libraries/botbuilder-stdlib/tests/delay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { delay } = require('../');

describe('delay', function () {
let sandbox;

beforeEach(function () {
sandbox = sinon.createSandbox({ useFakeTimers: true });
});
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-stdlib/tests/stringify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('stringify', function () {
const withoutReplacerToJSON = stringify(value);

const assertWithReplacerToJSON = JSON.stringify(
_replacer.call(JSON.parse(JSON.stringify(value, replacer)))
_replacer.call(JSON.parse(JSON.stringify(value, replacer))),
);
assert.ok(withReplacerToJSON.includes('"_id":":toJSON:replacer:_replacer"'));
assert.strictEqual(withReplacerToJSON, assertWithReplacerToJSON);
Expand Down

0 comments on commit df3b3f5

Please sign in to comment.