Skip to content

Commit

Permalink
Align HighlightStyle.scope's types to the type in Highlighter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marijnh committed Sep 16, 2024
1 parent 241b1de commit 31a6b30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class HighlightStyle implements Highlighter {
readonly themeType: "dark" | "light" | undefined

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

private constructor(
/// The tag styles used to create this highlight style.
Expand Down

0 comments on commit 31a6b30

Please sign in to comment.