Skip to content

Commit 31a6b30

Browse files
committed
Align HighlightStyle.scope's types to the type in Highlighter
FIX: Fix a TypeScript error when using `HighlightStyle` with the `exactOptionalPropertyTypes` typechecking option enabled. See https://discuss.codemirror.net/t/ts2379-error-it-codemirror-language/8626
1 parent 241b1de commit 31a6b30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/highlight.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class HighlightStyle implements Highlighter {
1919
readonly themeType: "dark" | "light" | undefined
2020

2121
readonly style: (tags: readonly Tag[]) => string | null
22-
readonly scope: ((type: NodeType) => boolean) | undefined
22+
readonly scope?: (type: NodeType) => boolean
2323

2424
private constructor(
2525
/// The tag styles used to create this highlight style.

0 commit comments

Comments
 (0)