Skip to content

Commit b3de480

Browse files
committed
fix remaining test by doing some upgrades
1 parent 79527f6 commit b3de480

File tree

9 files changed

+483
-625
lines changed

9 files changed

+483
-625
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,12 @@
396396
"@typescript-eslint/no-unsafe-return": "off",
397397
"@typescript-eslint/require-await": "off",
398398
"@typescript-eslint/restrict-template-expressions": "off",
399+
"@typescript-eslint/prefer-promise-reject-errors": "off",
399400

400401
"@typescript-eslint/ban-ts-comment": ["error", {"ts-expect-error": {"descriptionFormat": "^ - .+$"}}],
401-
"@typescript-eslint/ban-types": ["error", {"types": {"object": true}, "extendDefaults": true}],
402+
"@typescript-eslint/no-empty-object-type": "error",
403+
"@typescript-eslint/no-unsafe-function-type": "error",
404+
"@typescript-eslint/no-wrapper-object-types": "error",
402405
"@typescript-eslint/no-explicit-any": "error",
403406
"@typescript-eslint/no-shadow": ["error", {"builtinGlobals": false}],
404407
"@typescript-eslint/no-this-alias": "error",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"url": "/ext/data/schemas/recommended-dictionaries-schema.json"
4242
}
4343
],
44-
"typescript.tsdk": "node_modules\\typescript\\lib",
44+
"typescript.tsdk": "node_modules/typescript/lib",
4545
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix"
4646
}

ext/js/app/popup-factory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class PopupFactory {
188188
promises.push(promise);
189189
}
190190

191-
/** @type {undefined|unknown} */
191+
/** @type {undefined|Error} */
192192
let error = void 0;
193193
/** @type {{popup: import('popup').PopupAny, token: string}[]} */
194194
const results = [];

ext/js/comm/anki-connect.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ export class AnkiConnect {
479479
if (typeof result === 'object' && result !== null && !Array.isArray(result)) {
480480
const apiError = /** @type {import('core').SerializableObject} */ (result).error;
481481
if (typeof apiError !== 'undefined') {
482+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
482483
const error = new ExtensionError(`Anki error: ${apiError}`);
484+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
483485
error.data = {action, params, status: response.status, apiError: typeof apiError === 'string' ? apiError : `${apiError}`};
484486
throw error;
485487
}

package-lock.json

Lines changed: 468 additions & 614 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
"@types/node": "20.11.5",
7474
"@types/wanakana": "^5.3.0",
7575
"@types/zip.js": "^2.0.33",
76-
"@typescript-eslint/eslint-plugin": "^7.18.0",
77-
"@typescript-eslint/parser": "^7.18.0",
76+
"@typescript-eslint/eslint-plugin": "^8.18.0",
77+
"@typescript-eslint/parser": "^8.18.0",
7878
"@vitest/coverage-v8": "1.2.2",
7979
"ajv": "^8.17.1",
8080
"css": "^3.0.0",
@@ -89,7 +89,7 @@
8989
"eslint-plugin-no-unsanitized": "^4.0.2",
9090
"eslint-plugin-sonarjs": "^0.24.0",
9191
"eslint-plugin-unicorn": "^51.0.1",
92-
"eslint-plugin-unused-imports": "^3.2.0",
92+
"eslint-plugin-unused-imports": "^4.1.4",
9393
"eslint-plugin-vitest": "0.3.22",
9494
"fake-indexeddb": "^5.0.2",
9595
"handlebars": "^4.7.8",
@@ -102,8 +102,8 @@
102102
"prettier": "^3.2.5",
103103
"stylelint": "^16.2.1",
104104
"stylelint-config-recommended": "^14.0.0",
105-
"ts-json-schema-generator": "^1.5.1",
106-
"typescript": "^5.4.5",
105+
"ts-json-schema-generator": "^2.3.0",
106+
"typescript": "^5.7.2",
107107
"vitest": "^1.2.2"
108108
},
109109
"dependencies": {

test/data/vitest.json.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"test": {
33
"include": [
4-
"../**/json.test.js"
4+
"test/json.test.js"
55
]
66
}
77
}

types/ext/core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type TypeofResult = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol'
2222
export type SafeAny = any;
2323

2424
/** This type is used as an explicit way of permitting the `Function` type. */
25-
// eslint-disable-next-line @typescript-eslint/ban-types
25+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2626
export type SafeFunction = Function;
2727

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

types/ext/simple-dom-parser.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export type {
2424
/**
2525
* This type is used as a generic reference to an element object from a generic DOM API.
2626
*/
27-
// eslint-disable-next-line @typescript-eslint/ban-types
2827
export type Element = object;
2928

3029
export type ISimpleDomParser = {

0 commit comments

Comments
 (0)