Skip to content

Commit 02238bd

Browse files
committed
fixup!
1 parent 86db365 commit 02238bd

File tree

6 files changed

+24
-32
lines changed

6 files changed

+24
-32
lines changed

apps/site/pages/en/about/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ scalable network applications. In the following "hello world" example, many
1010
connections can be handled concurrently. Upon each connection, the callback is
1111
fired, but if there is no work to be done, Node.js will sleep.
1212

13-
```cjs twoslash
13+
```cjs
1414
const { createServer } = require('node:http');
1515

1616
const hostname = '127.0.0.1';

apps/site/pages/en/learn/typescript/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Take a look at this code snippet and then we can unpack it together:
2222
Maintainers note: this code is duplicated in the next article, please keep them in sync
2323
-->
2424

25-
```ts twoslash
25+
```ts
2626
type User = {
2727
name: string;
2828
age: number;

apps/site/pages/en/learn/typescript/transpile.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ If you have type errors in your TypeScript code, the TypeScript compiler will ca
7171
We will modify our code like this, to voluntarily introduce a type error:
7272

7373
```ts
74+
// @errors: 2322 2554
7475
type User = {
7576
name: string;
7677
age: number;
@@ -88,31 +89,4 @@ const justine: User = {
8889
const isJustineAnAdult: string = isAdult(justine, "I shouldn't be here!");
8990
```
9091

91-
And this is what TypeScript has to say about this:
92-
93-
```console
94-
example.ts:12:5 - error TS2322: Type 'string' is not assignable to type 'number'.
95-
96-
12 age: 'Secret!',
97-
~~~
98-
99-
example.ts:3:5
100-
3 age: number;
101-
~~~
102-
The expected type comes from property 'age' which is declared here on type 'User'
103-
104-
example.ts:15:7 - error TS2322: Type 'boolean' is not assignable to type 'string'.
105-
106-
15 const isJustineAnAdult: string = isAdult(justine, "I shouldn't be here!");
107-
~~~~~~~~~~~~~~~~
108-
109-
example.ts:15:51 - error TS2554: Expected 1 arguments, but got 2.
110-
111-
15 const isJustineAnAdult: string = isAdult(justine, "I shouldn't be here!");
112-
~~~~~~~~~~~~~~~~~~~~~~
113-
114-
115-
Found 3 errors in the same file, starting at: example.ts:12
116-
```
117-
11892
As you can see, TypeScript is very helpful in catching bugs before they even happen. This is one of the reasons why TypeScript is so popular among developers.

packages/rehype-shiki/src/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const { shiki, getLanguageDisplayName, highlightToHast, highlightToHtml } =
2222
createHighlighter({
2323
transformers: [
2424
transformerTwoslash({
25-
explicitTrigger: true,
25+
langs: ['ts', 'js', 'cjs', 'mjs'],
26+
throws: false,
2627
}),
2728
],
2829
// We use the faster WASM engine on the server instead of the web-optimized version.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
@import "@shikijs/twoslash/style-rich.css"
1+
@import "@shikijs/twoslash/style-rich.css";
2+
3+
.twoslash-popup-container {
4+
> :not(.twoslash-popup-code) {
5+
display: none !important;
6+
}
7+
8+
.twoslash-popup-code {
9+
z-index: 9999;
10+
}
11+
12+
position: fixed !important;
13+
}

packages/ui-components/src/Common/BaseCodeBox/index.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
bg-neutral-950;
99

1010
.content {
11-
@apply m-0
11+
@apply /*
12+
To allow tooltips to escape the overflow */ /*
13+
https://stackoverflow.com/questions/8837050/allow-specific-tag-to-override-overflowhidden */ m-0
14+
translate-x-0
15+
translate-y-0
16+
transform
1217
p-4;
1318

1419
& > code {

0 commit comments

Comments
 (0)