From 32dc83377250ab0a2e5417e89fcca8333d07e5e0 Mon Sep 17 00:00:00 2001 From: Jason Ian Green Date: Sat, 30 Mar 2024 10:16:13 +0000 Subject: [PATCH] chore: update remaining deps except typescript (#2396) * chore: update all deps except typescript * chore: bump config to 0.5.0 --- lib/compile/validate/dataType.ts | 1 + lib/core.ts | 4 ++++ lib/types/index.ts | 1 + package.json | 12 ++++++------ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/compile/validate/dataType.ts b/lib/compile/validate/dataType.ts index b315c2ce9..d8142b3e1 100644 --- a/lib/compile/validate/dataType.ts +++ b/lib/compile/validate/dataType.ts @@ -30,6 +30,7 @@ export function getSchemaTypes(schema: AnySchemaObject): JSONType[] { return types } +// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents export function getJSONTypes(ts: unknown | unknown[]): JSONType[] { const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] if (types.every(isJSONType)) return types diff --git a/lib/core.ts b/lib/core.ts index 3686ffe76..e41ca3e2a 100644 --- a/lib/core.ts +++ b/lib/core.ts @@ -343,14 +343,17 @@ export default class Ajv { validate(schema: JTDSchemaType, data: unknown): data is T // This overload is only intended for typescript inference, the first // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars validate( schema: T, data: unknown ): data is JTDDataType + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents validate(schema: AsyncSchema, data: unknown | T): Promise validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise validate( schemaKeyRef: AnySchema | string, // key, ref or schema object + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents data: unknown | T // to be validated ): boolean | Promise { let v: AnyValidateFunction | undefined @@ -374,6 +377,7 @@ export default class Ajv { compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction // This overload is only intended for typescript inference, the first // argument prevents manual type annotation from matching this overload + // eslint-disable-next-line @typescript-eslint/no-unused-vars compile( schema: T, _meta?: boolean diff --git a/lib/types/index.ts b/lib/types/index.ts index 054b10f6f..b5ef53eeb 100644 --- a/lib/types/index.ts +++ b/lib/types/index.ts @@ -48,6 +48,7 @@ export interface DataValidationCxt } export interface ValidateFunction { + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T errors?: null | ErrorObject[] evaluated?: Evaluated diff --git a/package.json b/package.json index 04ada38c4..d3df10a04 100644 --- a/package.json +++ b/package.json @@ -64,25 +64,25 @@ "uri-js": "^4.4.1" }, "devDependencies": { - "@ajv-validator/config": "^0.4.0", + "@ajv-validator/config": "^0.5.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-typescript": "^11.1.6", "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.19", + "@types/node": "^20.11.30", "@types/require-from-string": "^1.2.3", - "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.1", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", "ajv-formats": "^3.0.0-rc.0", "browserify": "^17.0.0", "chai": "^4.4.1", "cross-env": "^7.0.3", "dayjs": "^1.11.10", "dayjs-plugin-utc": "^0.1.2", - "eslint": "^7.32.0", - "eslint-config-prettier": "^7.2.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "fast-uri": "^2.3.0", "glob": "^10.3.10", "husky": "^9.0.11",