Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions runtime/fundamentals/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Copy link
Member Author

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)


## 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.
Copy link
Member Author

Choose a reason for hiding this comment

The 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

Expand Down Expand Up @@ -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:
Copy link
Member Author

Choose a reason for hiding this comment

The 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"
Expand Down