Skip to content

Commit b3e582c

Browse files
authored
chore: setup typescript project references so IDE shows hints (#247)
1 parent 1aea923 commit b3e582c

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages/*/types
77
examples/*/types
88
/.pnp
99
.pnp.js
10-
10+
tsconfig.tsbuildinfo
1111
# testing
1212
coverage
1313

Diff for: examples/editor/tsconfig.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
1616
"noEmit": true,
17-
"jsx": "react-jsx"
18-
// "paths": {
19-
// "@blocknote/core": ["../../packages/core/src"]
20-
// }
17+
"jsx": "react-jsx",
18+
"composite": true
2119
},
2220
"include": ["src"],
2321
"references": [
24-
{ "path": "./tsconfig.node.json" }
25-
// { "path": "../../packages/core/tsconfig.json" }
22+
{ "path": "./tsconfig.node.json" },
23+
{ "path": "../../packages/core/" },
24+
{ "path": "../../packages/react/" }
2625
]
2726
}

Diff for: examples/vanilla/tsconfig.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
1616
"noEmit": true,
17-
"jsx": "react-jsx"
17+
"jsx": "react-jsx",
18+
"composite": true
1819
// "paths": {
1920
// "@blocknote/core": ["../../packages/core/src"]
2021
// }
2122
},
2223
"include": ["src"],
2324
"references": [
24-
{ "path": "./tsconfig.node.json" }
25-
// { "path": "../../packages/core/tsconfig.json" }
25+
{ "path": "./tsconfig.node.json" },
26+
{ "path": "../../packages/core/" },
27+
{ "path": "../../packages/react/" }
2628
]
2729
}

Diff for: packages/react/tsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@
2020
"composite": true,
2121
"skipLibCheck": true
2222
},
23-
"include": ["src"]
23+
"include": ["src"],
24+
"references": [
25+
{
26+
"path": "../core"
27+
}
28+
]
2429
}

Diff for: packages/website/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"skipLibCheck": true,
1919
"paths": {
2020
"@theme/*": ["./docs/.vitepress/theme/*"]
21-
}
21+
},
22+
"composite": true
2223
},
2324
"include": [
2425
"src",
@@ -28,5 +29,6 @@
2829
// Also need to explicitly include Markdown files to have TS intellisense work with Volar
2930
"docs/**/*.md"
3031
],
32+
"references": [{ "path": "../core/" }, { "path": "../react/" }],
3133
"exclude": ["node_modules/"]
3234
}

0 commit comments

Comments
 (0)