Skip to content

Commit

Permalink
chore(vision): fix typescript issue related to reexporting codemirror…
Browse files Browse the repository at this point in the history
… extensions

Fixes TS2742: The inferred type of 'codemirrorExtensions' cannot be named without a reference to '@codemirror/state'. This is likely not portable. A type annotation is necessary.
  • Loading branch information
bjoerge authored and rexxars committed Feb 14, 2024
1 parent d09db4c commit 26c5f47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@sanity/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@codemirror/lang-javascript": "^6.0.2",
"@codemirror/language": "^6.2.1",
"@codemirror/search": "^6.0.1",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.1.1",
"@juggle/resize-observer": "^3.3.1",
"@lezer/highlight": "^1.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@sanity/vision/src/codemirror/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
syntaxHighlighting,
} from '@codemirror/language'
import {highlightSelectionMatches} from '@codemirror/search'
import {Extension} from '@codemirror/state'
import {
drawSelection,
highlightActiveLine,
Expand All @@ -17,7 +18,7 @@ import {
lineNumbers,
} from '@codemirror/view'

export const codemirrorExtensions = [
export const codemirrorExtensions: Extension[] = [
[javascriptLanguage],
lineNumbers(),
highlightActiveLine(),
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 26c5f47

Please sign in to comment.