From 95212b63b9262a28109949eccd16aef53c4e73cc Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 5 Jun 2025 07:59:49 +0800 Subject: [PATCH 1/5] fix: update schemastore catlog url --- src/rules/no-invalid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/no-invalid.ts b/src/rules/no-invalid.ts index 0fd87dfb..79561ad9 100644 --- a/src/rules/no-invalid.ts +++ b/src/rules/no-invalid.ts @@ -25,7 +25,7 @@ import fs from "fs"; import { getCwd, getFilename, getSourceCode } from "../utils/compat"; import { toCompatCreate } from "eslint-json-compat-utils"; -const CATALOG_URL = "https://www.schemastore.org/api/json/catalog.json"; +const CATALOG_URL = "https://json.schemastore.org/schema-catalog.json"; /** * Checks if match file From a850ec55e93ba9f22a858574a75a294717264ba9 Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 5 Jun 2025 08:00:59 +0800 Subject: [PATCH 2/5] Create eight-timers-tickle.md --- .changeset/eight-timers-tickle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eight-timers-tickle.md diff --git a/.changeset/eight-timers-tickle.md b/.changeset/eight-timers-tickle.md new file mode 100644 index 00000000..4768f7bc --- /dev/null +++ b/.changeset/eight-timers-tickle.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-json-schema-validator": patch +--- + +fix: update schemastore catlog url From 2feba5c384652369dd68c998c134fad16726940f Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 5 Jun 2025 08:18:18 +0800 Subject: [PATCH 3/5] Update src/rules/no-invalid.ts --- src/rules/no-invalid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/no-invalid.ts b/src/rules/no-invalid.ts index 79561ad9..a01084fa 100644 --- a/src/rules/no-invalid.ts +++ b/src/rules/no-invalid.ts @@ -25,7 +25,7 @@ import fs from "fs"; import { getCwd, getFilename, getSourceCode } from "../utils/compat"; import { toCompatCreate } from "eslint-json-compat-utils"; -const CATALOG_URL = "https://json.schemastore.org/schema-catalog.json"; +const CATALOG_URL = "https://json.schemastore.org/schema-catalog.json/api/json/catalog.json"; /** * Checks if match file From 6a47bbdc5fb4643ab63dd536ba8e0ba50a90b641 Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 5 Jun 2025 08:18:57 +0800 Subject: [PATCH 4/5] Update src/rules/no-invalid.ts --- src/rules/no-invalid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/no-invalid.ts b/src/rules/no-invalid.ts index a01084fa..4a8f6f9d 100644 --- a/src/rules/no-invalid.ts +++ b/src/rules/no-invalid.ts @@ -25,7 +25,7 @@ import fs from "fs"; import { getCwd, getFilename, getSourceCode } from "../utils/compat"; import { toCompatCreate } from "eslint-json-compat-utils"; -const CATALOG_URL = "https://json.schemastore.org/schema-catalog.json/api/json/catalog.json"; +const CATALOG_URL = "https://json.schemastore.org/api/json/catalog.json"; /** * Checks if match file From ae6ef8f93af0d09592f8e8b45f87c4917eb39c9d Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 5 Jun 2025 08:34:46 +0800 Subject: [PATCH 5/5] fix: incompatible typing issues --- src/utils/ast/js/utils.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/utils/ast/js/utils.ts b/src/utils/ast/js/utils.ts index 3a5427c9..5a05d90a 100644 --- a/src/utils/ast/js/utils.ts +++ b/src/utils/ast/js/utils.ts @@ -1,10 +1,8 @@ -// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair -- ignore -/* eslint-disable @typescript-eslint/no-explicit-any -- ignore */ -import type { AST } from "vue-eslint-parser"; -import type { RuleContext } from "../../../types"; -// @ts-expect-error -- no type def import * as eslintUtils from "@eslint-community/eslint-utils"; import type { Variable } from "eslint-scope"; +import type { AST } from "vue-eslint-parser"; + +import type { RuleContext } from "../../../types"; import { getSourceCode } from "../../compat"; /** @@ -58,8 +56,8 @@ export function getStringLiteralValue( ): string | null { if (node.type === "Literal") { if (node.value == null) { - if ((node as any).bigint != null) { - return String((node as any).bigint); + if (node.bigint != null) { + return String(node.bigint); } } return String(node.value); @@ -88,8 +86,12 @@ function findVariable( export function getStaticValue( context: RuleContext, node: AST.ESLintNode, -): { value: any } | null { - return eslintUtils.getStaticValue(node, getScope(context, node)); +): { value?: unknown; optional?: boolean } | null { + return eslintUtils.getStaticValue( + // @ts-expect-error -- `eslintUtils` is typed now but incompatible with Vue AST typings + node, + getScope(context, node), + ); } /** @@ -140,9 +142,13 @@ function getScope(context: RuleContext, currentNode: AST.ESLintNode) { const inner = currentNode.type !== "Program"; const scopeManager = getSourceCode(context).scopeManager; - let node: any = currentNode; + let node: AST.Node | null = currentNode; for (; node; node = node.parent || null) { - const scope = scopeManager.acquire(node, inner); + const scope = scopeManager.acquire( + // @ts-expect-error -- incompatible with Vue AST typings + node, + inner, + ); if (scope) { if (scope.type === "function-expression-name") {