Skip to content

Commit 9792496

Browse files
committed
refactor: use actively maintained @unts/json-schema-migrate instead
1 parent c00ded6 commit 9792496

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"predocs:watch": "yarn build",
4040
"prerelease": "yarn test && yarn build",
4141
"preversion": "yarn test && git add .",
42-
"release": "changeset publish",
42+
"release": "clean-pkg-json && changeset publish",
4343
"test": "env-cmd -e test yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
4444
"ts": "env-cmd -e base node -r esbuild-register",
4545
"update": "yarn ts ./tools/update && yarn lint-fix",
@@ -51,11 +51,11 @@
5151
},
5252
"dependencies": {
5353
"@eslint-community/eslint-utils": "^4.3.0",
54+
"@unts/json-schema-migrate": "^2.0.1",
5455
"ajv": "^8.0.0",
5556
"debug": "^4.3.1",
56-
"eslint-compat-utils": "^0.6.0",
57+
"eslint-compat-utils": "^0.6.5",
5758
"eslint-json-compat-utils": "^0.2.1",
58-
"json-schema-migrate": "^2.0.0",
5959
"jsonc-eslint-parser": "^2.0.0",
6060
"minimatch": "^9.0.0 || ^10.0.0",
6161
"synckit": "^0.11.1",
@@ -89,7 +89,7 @@
8989
"eslint-config-prettier": "^10.0.0",
9090
"eslint-plugin-eslint-plugin": "^6.0.0",
9191
"eslint-plugin-jsdoc": "^50.0.0",
92-
"eslint-plugin-json-schema-validator": "^5.0.0",
92+
"eslint-plugin-json-schema-validator": "link:.",
9393
"eslint-plugin-jsonc": "^2.0.0",
9494
"eslint-plugin-markdown": "^5.0.0",
9595
"eslint-plugin-n": "^17.2.0",

src/utils/schema.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import path from "path";
1+
import { draft7 as migrateToDraft7 } from "@unts/json-schema-migrate";
2+
import debugBuilder from "debug";
23
import fs from "fs";
4+
import path from "path";
5+
36
import type { RuleContext } from "../types";
4-
import { syncGet, get } from "./http-client";
5-
import debugBuilder from "debug";
6-
import type { SchemaObject } from "./types";
7-
import { draft7 as migrateToDraft7 } from "json-schema-migrate";
87
import { getCwd } from "./compat";
8+
import { get, syncGet } from "./http-client";
9+
import type { SchemaObject } from "./types";
10+
911
const debug = debugBuilder("eslint-plugin-json-schema-validator:utils-schema");
1012

1113
const TTL = 1000 * 60 * 60 * 24;

src/utils/validator-factory.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import { draft7 as migrateToDraft7 } from "@unts/json-schema-migrate";
2+
3+
import type { RuleContext } from "../types";
14
import type {
25
DefinedError,
36
ErrorObject,
7+
RegExpEngine,
48
SchemaObject,
59
ValidateFunction,
6-
RegExpEngine,
710
} from "./ajv";
8-
import type { RuleContext } from "../types";
911
import Ajv from "./ajv";
10-
import { draft7 as migrateToDraft7 } from "json-schema-migrate";
1112
import { loadSchema } from "./schema";
1213

1314
// eslint-disable-next-line func-style -- ignore

tests/src/eslint-plugin.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ describe("Integration with eslint-plugin-json-schema-validator", () => {
3535
if (semver.satisfies(ESLint.version, "<7.0.0")) return;
3636
const engine = new ESLint({
3737
cwd: path.join(TEST_FIXTURES_ROOT, "flat-config-test01"),
38-
// @ts-expect-error -- typing bug
3938
overrideConfigFile: true,
40-
// @ts-expect-error -- typing bug
4139
overrideConfig: plugin.configs["flat/recommended"],
4240
});
4341
const results = await engine.lintFiles(["src"]);

tests/src/rules/no-invalid.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ tester.run(
2424
{
2525
filename: path.join(__dirname, ".eslintrc.js"),
2626
code: 'module.exports = { "extends": [ require.resolve("eslint-config-foo") ] }',
27-
// @ts-expect-error -- typeerror
2827
languageOptions: {
2928
// eslint-disable-next-line n/no-extraneous-require -- test
3029
parser: require("espree"),
@@ -74,7 +73,6 @@ tester.run(
7473
{
7574
filename: path.join(__dirname, ".eslintrc.js"),
7675
code: 'module.exports = { "extends": [ 42 ] }',
77-
// @ts-expect-error -- typeerror
7876
languageOptions: {
7977
// eslint-disable-next-line n/no-extraneous-require -- test
8078
parser: require("espree"),
@@ -289,7 +287,6 @@ trailingComma = "es3"
289287
tabWidth = 4
290288
semi = false
291289
singleQuote = true`,
292-
// @ts-expect-error -- typeerror
293290
languageOptions: {
294291
parser: require("toml-eslint-parser"),
295292
},

0 commit comments

Comments
 (0)