-
Notifications
You must be signed in to change notification settings - Fork 332
Minor improvement to typescript page #2689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,19 +11,16 @@ oldUrl: | |
| - /runtime/fundamentals/ | ||
| --- | ||
|
|
||
| TypeScript is a first class language in Deno, just like JavaScript or | ||
| WebAssembly. You can run or import TypeScript without installing anything more | ||
| than the Deno CLI. With its built-in TypeScript compiler, Deno will compile your | ||
| TypeScript code to JavaScript with no extra config needed. Deno can also type | ||
| check your TypeScript code, without requiring a separate type checking tool like | ||
| `tsc`. | ||
| TypeScript is a first class language in Deno. You can run or import TypeScript | ||
| without installing anything more than the Deno CLI. With its built-in TypeScript | ||
| compiler, Deno will compile your TypeScript code to JavaScript with no extra | ||
| config needed. Deno can also type check your TypeScript code, without requiring | ||
| a separate type checking tool like `tsc`. | ||
|
|
||
| ## Type Checking | ||
|
|
||
| One of the main advantages of TypeScript is that it can make your code type | ||
| safe, catching errors during development rather than runtime. TypeScript is a | ||
| superset of JavaScript meaning that syntactically valid JavaScript becomes | ||
| TypeScript with warnings about being "unsafe". | ||
| safe, catching errors during development rather than runtime. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed "TypeScript is a superset of JavaScript meaning that syntactically valid JavaScript becomes TypeScript with warnings about being "unsafe"." because some people quibble about TS not being a strict superset of JS and also the word "unsafe" makes me personally think about unsafe code in Rust or other languages. |
||
|
|
||
| :::note | ||
|
|
||
|
|
@@ -169,7 +166,7 @@ the TypeScript module that imports the JavaScript module. | |
| import { add } from "./add.js"; | ||
| ``` | ||
|
|
||
| This is also useful for NPM packages that don't provide type information: | ||
| This is also useful for npm packages that don't provide type information: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preferred casing of npm according to npm https://github.com/npm/cli#faq-on-branding |
||
|
|
||
| ```ts title="main.ts" | ||
| // @ts-types="npm:@types/lodash" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed ", just like JavaScript or WebAssembly" here because WebAssembly isn't really first class (it can be loaded, but not executed directly yet)