Skip to content

Commit 207eac4

Browse files
authored
chore: fix ci errors (#423)
* chore: fix typing error * fix ci errors * fix test * update workflows * update
1 parent e7fc3ec commit 207eac4

33 files changed

+214
-109
lines changed

.github/workflows/GHPages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
# Allow one concurrent deployment
1515
concurrency:
16-
group: pages
16+
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:

.github/workflows/NodeCI.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
pull_request:
77
branches: [main]
88

9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
lint:
1116
runs-on: ubuntu-latest
@@ -14,10 +19,19 @@ jobs:
1419
- uses: actions/setup-node@v4
1520
with:
1621
node-version: lts/*
22+
- uses: actions/cache/restore@v4
23+
with:
24+
path: node_modules
25+
key: ${{ runner.os }}-${{ hashFiles('package.json') }}-${{ github.ref }}
1726
- name: Install Packages
1827
run: yarn
1928
- name: Lint
2029
run: yarn lint
30+
- uses: actions/cache/save@v4
31+
if: always()
32+
with:
33+
path: node_modules
34+
key: ${{ runner.os }}-${{ hashFiles('package.json') }}-${{ github.ref }}
2135
test:
2236
strategy:
2337
matrix:

.github/workflows/Release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- main
77

8+
# Allow one concurrent deployment
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
813
jobs:
914
release:
1015
name: Release
@@ -16,10 +21,10 @@ jobs:
1621
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1722
fetch-depth: 0
1823

19-
- name: Setup Node.js 16
24+
- name: Setup Node.js
2025
uses: actions/setup-node@v4
2126
with:
22-
node-version: 18
27+
node-version: "lts/*"
2328

2429
- name: Install Dependencies
2530
run: yarn --ignore-engines
@@ -38,4 +43,3 @@ jobs:
3843
title: "chore: release eslint-plugin-json-schema-validator"
3944
env:
4045
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/format.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: 👔 Format
33
on:
44
workflow_dispatch: null
55

6+
# Allow one concurrent deployment
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
611
jobs:
712
format:
813
runs-on: ubuntu-latest

.github/workflows/stale.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ permissions:
77
issues: write
88
pull-requests: write
99

10+
# Allow one concurrent deployment
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
stale:
1217
if: github.repository == 'ota-meshi/eslint-plugin-json-schema-validator'

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/ast/js/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ function findVariable(
7777
context: RuleContext,
7878
node: AST.ESLintIdentifier,
7979
): Variable | null {
80-
return eslintUtils.findVariable(getScope(context, node), node);
80+
return eslintUtils.findVariable(
81+
getScope(context, node),
82+
node,
83+
) as Variable | null;
8184
}
8285

8386
/**

0 commit comments

Comments
 (0)