Skip to content

Commit 1852d39

Browse files
committed
chore: linting
1 parent 5e64939 commit 1852d39

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/quartz/QuartzConfigService.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Document, type YAMLMap, parseDocument } from "yaml";
1+
import { Document, parseDocument } from "yaml";
22
import { RepositoryConnection } from "src/repositoryConnection/RepositoryConnection";
33
import type { QuartzV5Config, QuartzLockFile } from "./QuartzConfigTypes";
44

@@ -10,10 +10,11 @@ const SCHEMA_COMMENT =
1010
"yaml-language-server: $schema=./quartz/plugins/quartz-plugins.schema.json";
1111

1212
type ConfigFormat = "yaml" | "json";
13+
type YamlDocument = InstanceType<typeof Document>;
1314

1415
export class QuartzConfigService {
1516
private repo: RepositoryConnection;
16-
private yamlDocument: Document<YAMLMap> | null = null;
17+
private yamlDocument: YamlDocument | null = null;
1718
private configFormat: ConfigFormat | null = null;
1819

1920
constructor(repo: RepositoryConnection) {
@@ -32,7 +33,7 @@ export class QuartzConfigService {
3233
keepSourceTokens: true,
3334
});
3435

35-
this.yamlDocument = parsed as Document<YAMLMap>;
36+
this.yamlDocument = parsed;
3637

3738
return parsed.toJSON() as QuartzV5Config;
3839
}
@@ -66,7 +67,7 @@ export class QuartzConfigService {
6667
return this.yamlDocument.toString();
6768
}
6869

69-
const doc = new Document<YAMLMap>(config);
70+
const doc = new Document(config);
7071
this.ensureSchemaComment(doc);
7172

7273
return doc.toString();
@@ -160,7 +161,7 @@ export class QuartzConfigService {
160161
);
161162
}
162163

163-
private ensureSchemaComment(doc: Document<YAMLMap>): void {
164+
private ensureSchemaComment(doc: YamlDocument): void {
164165
// The `yaml` library attaches a leading `# yaml-language-server: ...`
165166
// line from a parsed document to the first key node's `commentBefore`,
166167
// not to `doc.commentBefore` (which stays null). Checking only

0 commit comments

Comments
 (0)