Skip to content

Commit cf1d0a2

Browse files
committed
fix ci errors
1 parent ffaea2c commit cf1d0a2

File tree

16 files changed

+81
-79
lines changed

16 files changed

+81
-79
lines changed

docs/.vitepress/config.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ export default async (): Promise<UserConfig<DefaultTheme.Config>> => {
3333

3434
// Generate a schema store cache and include it in the bundle.
3535
schema.loadJson(
36-
"https://json.schemastore.org/api/json/catalog.json",
36+
"https://www.schemastore.org/api/json/catalog.json",
3737
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- ignore
3838
{} as any,
3939
);
4040
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- ignore
41-
schema.loadSchema("https://json.schemastore.org/eslintrc.json", {} as any);
41+
schema.loadSchema("https://www.schemastore.org/eslintrc.json", {} as any);
4242
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- ignore
43-
schema.loadSchema("https://json.schemastore.org/prettierrc.json", {} as any);
43+
schema.loadSchema("https://www.schemastore.org/prettierrc.json", {} as any);
4444
schema.loadSchema(
45-
"https://json.schemastore.org/partial-eslint-plugins.json",
45+
"https://www.schemastore.org/partial-eslint-plugins.json",
4646
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- ignore
4747
{} as any,
4848
);

docs/.vitepress/shim/require-from-cache.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import catalog from "../../../.cached_schemastore/json.schemastore.org/api/json/catalog.json";
2-
import eslintrc from "../../../.cached_schemastore/json.schemastore.org/eslintrc.json";
3-
import partialEslintPlugins from "../../../.cached_schemastore/json.schemastore.org/partial-eslint-plugins.json";
4-
import prettierrc from "../../../.cached_schemastore/json.schemastore.org/prettierrc.json";
1+
import catalog from "../../../.cached_schemastore/www.schemastore.org/api/json/catalog.json";
2+
import eslintrc from "../../../.cached_schemastore/www.schemastore.org/eslintrc.json";
3+
import partialEslintPlugins from "../../../.cached_schemastore/www.schemastore.org/partial-eslint-plugins.json";
4+
import prettierrc from "../../../.cached_schemastore/www.schemastore.org/prettierrc.json";
55

66
/**
77
* @param {string} p
88
*/
99
export default function fakeRequire(p) {
1010
if (
11-
p.endsWith(".cached_schemastore/json.schemastore.org/api/json/catalog.json")
11+
p.endsWith(".cached_schemastore/www.schemastore.org/api/json/catalog.json")
1212
) {
1313
return { ...catalog, timestamp: Infinity };
1414
}
15-
if (p.endsWith(".cached_schemastore/json.schemastore.org/eslintrc.json")) {
15+
if (p.endsWith(".cached_schemastore/www.schemastore.org/eslintrc.json")) {
1616
return { ...eslintrc, timestamp: Infinity };
1717
}
1818
if (
1919
p.endsWith(
20-
".cached_schemastore/json.schemastore.org/partial-eslint-plugins.json",
20+
".cached_schemastore/www.schemastore.org/partial-eslint-plugins.json",
2121
)
2222
) {
2323
return { ...partialEslintPlugins, timestamp: Infinity };
2424
}
25-
if (p.endsWith(".cached_schemastore/json.schemastore.org/prettierrc.json")) {
25+
if (p.endsWith(".cached_schemastore/www.schemastore.org/prettierrc.json")) {
2626
return { ...prettierrc, timestamp: Infinity };
2727
}
2828
console.log(`unknown:${p}`);

docs/.vitepress/theme/components/playground-block.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const DEFAULT_CODE = `{
6868
6969
const JS_CODE = `/* eslint json-schema-validator/no-invalid: [
7070
"error",
71-
"https://json.schemastore.org/eslintrc"
71+
"https://www.schemastore.org/eslintrc"
7272
]
7373
-- About options: https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html#options
7474
*/
@@ -85,7 +85,7 @@ module.exports = {
8585
`;
8686
const JSON_CODE = `/* eslint json-schema-validator/no-invalid: [
8787
"error",
88-
"https://json.schemastore.org/eslintrc"
88+
"https://www.schemastore.org/eslintrc"
8989
]
9090
-- About options: https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html#options
9191
*/
@@ -100,7 +100,7 @@ const JSON_CODE = `/* eslint json-schema-validator/no-invalid: [
100100
}
101101
}
102102
`;
103-
const YAML_CODE = `# eslint json-schema-validator/no-invalid: [error, "https://json.schemastore.org/eslintrc"]
103+
const YAML_CODE = `# eslint json-schema-validator/no-invalid: [error, "https://www.schemastore.org/eslintrc"]
104104
# -- About options: https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html#options
105105
extends:
106106
- 42
@@ -110,7 +110,7 @@ rules:
110110
"eqeqeq": "warn"
111111
"strict": "off"
112112
`;
113-
const TOML_CODE = `# eslint json-schema-validator/no-invalid: [error, "https://json.schemastore.org/prettierrc"]
113+
const TOML_CODE = `# eslint json-schema-validator/no-invalid: [error, "https://www.schemastore.org/prettierrc"]
114114
# -- About options: https://ota-meshi.github.io/eslint-plugin-json-schema-validator/rules/no-invalid.html#options
115115
trailingComma = "es3"
116116
tabWidth = 4

docs/rules/no-invalid.md

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ This rule validates the file with JSON Schema and reports errors.
2424
// File name is ".eslintrc.json"
2525
/* eslint json-schema-validator/no-invalid: 'error' */
2626
{
27-
"overrides": [
28-
{
29-
"files": ["good"],
30-
/* ✓ GOOD */
31-
"extends": ["foo"]
32-
},
33-
{
34-
"files": ["bad"],
35-
/* ✗ BAD */
36-
"extends": [42]
37-
}
38-
]
27+
overrides: [
28+
{
29+
files: ["good"],
30+
/* ✓ GOOD */
31+
extends: ["foo"],
32+
},
33+
{
34+
files: ["bad"],
35+
/* ✗ BAD */
36+
extends: [42],
37+
},
38+
],
3939
}
4040
```
4141

@@ -45,19 +45,21 @@ This rule validates the file with JSON Schema and reports errors.
4545

4646
```json5
4747
{
48-
"json-schema-validator/no-invalid": [
49-
"error",
48+
"json-schema-validator/no-invalid": [
49+
"error",
50+
{
51+
schemas: [
5052
{
51-
"schemas": [
52-
{
53-
"fileMatch": [".eslintrc.json"],
54-
"schema": {/* JSON Schema Definition */} // or string
55-
}
56-
],
57-
"useSchemastoreCatalog": true,
58-
"mergeSchemas": true // or ["$schema", "options", "catalog"]
59-
}
60-
]
53+
fileMatch: [".eslintrc.json"],
54+
schema: {
55+
/* JSON Schema Definition */
56+
}, // or string
57+
},
58+
],
59+
useSchemastoreCatalog: true,
60+
mergeSchemas: true, // or ["$schema", "options", "catalog"]
61+
},
62+
],
6163
}
6264
```
6365

@@ -76,24 +78,24 @@ This option can also be given a JSON schema file or URL. This is useful for conf
7678
```js
7779
/* eslint json-schema-validator/no-invalid: [
7880
"error",
79-
"https://json.schemastore.org/eslintrc"
81+
"https://www.schemastore.org/eslintrc"
8082
]
8183
*/
8284

8385
module.exports = {
84-
overrides: [
85-
{
86-
files: ["good"],
87-
/* ✓ GOOD */
88-
extends: ["foo"]
89-
},
90-
{
91-
files: ["bad"],
92-
/* ✗ BAD */
93-
extends: [42]
94-
}
95-
]
96-
}
86+
overrides: [
87+
{
88+
files: ["good"],
89+
/* ✓ GOOD */
90+
extends: ["foo"],
91+
},
92+
{
93+
files: ["bad"],
94+
/* ✗ BAD */
95+
extends: [42],
96+
},
97+
],
98+
};
9799
```
98100

99101
</eslint-code-block>
@@ -120,9 +122,9 @@ To match a custom block, use a glob like this:
120122

121123
```json5
122124
{
123-
// If you want to match the <i18n> block.
124-
"fileMatch": ["**/*blockType=i18n*"],
125-
"schema": { "type": "object" /* JSON Schema Definition */ }
125+
// If you want to match the <i18n> block.
126+
fileMatch: ["**/*blockType=i18n*"],
127+
schema: { type: "object" /* JSON Schema Definition */ },
126128
}
127129
```
128130

src/utils/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { SchemaObject } from "./types";
1010

1111
const debug = debugBuilder("eslint-plugin-json-schema-validator:utils-schema");
1212

13-
const TTL = 1000 * 60 * 60 * 24;
13+
const TTL = 1000 * 60 * 60 * 24; // 1 day
1414
const RELOADING = new Set<string>();
1515

1616
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "http://json.schemastore.org/tsconfig",
2+
"$schema": "http://www.schemastore.org/tsconfig",
33
"compilerOptions": 42
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"$schema" = "http://json.schemastore.org/tsconfig"
1+
"$schema" = "http://www.schemastore.org/tsconfig"
22
compilerOptions = 42
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
$schema: "http://json.schemastore.org/tsconfig"
1+
$schema: "http://www.schemastore.org/tsconfig"
22
compilerOptions: 42
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"options": ["https://json.schemastore.org/eslintrc"]
2+
"options": ["https://www.schemastore.org/eslintrc"]
33
}

tests/fixtures/rules/no-invalid/invalid/eslintrc-test/_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"eslintrc-escape-input.json",
1212
"eslintrc-js-input.js"
1313
],
14-
"schema": "https://json.schemastore.org/eslintrc"
14+
"schema": "https://www.schemastore.org/eslintrc"
1515
}
1616
]
1717
}

0 commit comments

Comments
 (0)