Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [#4684] ESLint issues in botbuilder-stdlib #4814

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading