Skip to content

Commit b134868

Browse files
Logicer16ota-meshi
andauthored
Refine flat config types (#311)
* refine flat config types * Create proud-vans-bake.md --------- Co-authored-by: Yosuke Ota <[email protected]>
1 parent d7d9666 commit b134868

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.changeset/proud-vans-bake.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-json-schema-validator": minor
3+
---
4+
5+
feat: improved compatibility with `@types/eslint` for flat config.

src/configs/flat/base.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ESLint } from "eslint";
1+
import type { ESLint, Linter } from "eslint";
22
import * as jsoncParser from "jsonc-eslint-parser";
33
import * as yamlParser from "yaml-eslint-parser";
44
import * as tomlParser from "toml-eslint-parser";
@@ -54,4 +54,4 @@ export default [
5454
"spaced-comment": "off",
5555
},
5656
},
57-
];
57+
] satisfies Linter.FlatConfig[] as Linter.FlatConfig[];

src/configs/flat/recommended.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Linter } from "eslint";
12
import base from "./base";
23
export default [
34
...base,
@@ -7,4 +8,4 @@ export default [
78
"json-schema-validator/no-invalid": "warn",
89
},
910
},
10-
];
11+
] satisfies Linter.FlatConfig[];

tools/update-rulesets.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export = {
5656

5757
for (const rec of ["recommended"] as const) {
5858
let content = `
59+
import type { Linter } from "eslint";
5960
import base from './base';
6061
export default [
6162
...base,
@@ -76,7 +77,7 @@ export default [
7677
.join(",\n")}
7778
},
7879
}
79-
]
80+
] satisfies Linter.FlatConfig[]
8081
`;
8182

8283
const filePath = path.resolve(__dirname, FLAT_RULESET_NAME[rec]);

0 commit comments

Comments
 (0)