-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: type check codeblocks in Markdown file with "deno test --doc" (#…
- Loading branch information
1 parent
d0ec29b
commit c276b52
Showing
6 changed files
with
223 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Check [WILDCARD]/test/doc_markdown/doc.md$11-14.js | ||
Check [WILDCARD]/test/doc_markdown/doc.md$17-20.ts | ||
Check [WILDCARD]/test/doc_markdown/doc.md$23-26.ts | ||
error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. | ||
const a: string = 42; | ||
^ | ||
at [WILDCARD]/test/doc_markdown/doc.md$23-26.ts:1:7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Documentation | ||
|
||
The following block does not have a language attribute and should be ignored: | ||
|
||
``` | ||
This is a fenced block without attributes, it's invalid and it should be ignored. | ||
``` | ||
|
||
The following block should be given a js extension on extraction: | ||
|
||
```js | ||
console.log("js"); | ||
``` | ||
|
||
The following block should be given a ts extension on extraction: | ||
|
||
```ts | ||
console.log("ts"); | ||
``` | ||
|
||
The following example will trigger the type-checker to fail: | ||
|
||
```ts | ||
const a: string = 42; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters