Skip to content

Commit

Permalink
Fix some types
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmaa committed Dec 16, 2024
1 parent 19ae829 commit 91ddbc7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions ext/js/comm/anki-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ export class AnkiConnect {
if (typeof result === 'object' && result !== null && !Array.isArray(result)) {
const apiError = /** @type {import('core').SerializableObject} */ (result).error;
if (typeof apiError !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
const error = new ExtensionError(`Anki error: ${apiError}`);

Check failure on line 482 in ext/js/comm/anki-connect.js

View workflow job for this annotation

GitHub Actions / Static Analysis

'apiError' may use Object's default stringification format ('[object Object]') when stringified
// eslint-disable-next-line @typescript-eslint/no-base-to-string
error.data = {action, params, status: response.status, apiError: typeof apiError === 'string' ? apiError : `${apiError}`};

Check failure on line 483 in ext/js/comm/anki-connect.js

View workflow job for this annotation

GitHub Actions / Static Analysis

'apiError' may use Object's default stringification format ('[object Object]') when stringified
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion types/ext/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type TypeofResult = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol'
export type SafeAny = any;

/** This type is used as an explicit way of permitting the `Function` type. */
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unsafe-function-type

Check failure on line 25 in types/ext/core.d.ts

View workflow job for this annotation

GitHub Actions / Static Analysis

Definition for rule '@typescript-eslint/ban-types' was not found
export type SafeFunction = Function;

/** This type is used as an explicit way of permitting the `any` type. */
Expand Down

0 comments on commit 91ddbc7

Please sign in to comment.