Skip to content

Commit

Permalink
Note that verbatimModuleSyntax meets the suggested criteria for `isol…
Browse files Browse the repository at this point in the history
…atedModules` (#2592)

* Note that verbatimModuleSyntax meets the suggested criteria for `isolatedModules`

See also vuejs/create-vue#401

* Update src/guide/typescript/overview.md

---------

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
  • Loading branch information
bmulholland and NataliaTepluhina committed Dec 6, 2023
1 parent 6f67576 commit 32c0a6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/guide/typescript/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Projects scaffolded via `create-vue` include pre-configured `tsconfig.json`. The

When configuring `tsconfig.json` manually, some notable options include:

- [`compilerOptions.isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules) is set to `true` because Vite uses [esbuild](https://esbuild.github.io/) for transpiling TypeScript and is subject to single-file transpile limitations.
- [`compilerOptions.isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules) is set to `true` because Vite uses [esbuild](https://esbuild.github.io/) for transpiling TypeScript and is subject to single-file transpile limitations. [`compilerOptions.verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) is [a superset of `isolatedModules`](https://github.com/microsoft/TypeScript/issues/53601) and is a good choice, too - it's what `[@vue/tsconfig](https://github.com/vuejs/tsconfig)` uses.

- If you're using Options API, you need to set [`compilerOptions.strict`](https://www.typescriptlang.org/tsconfig#strict) to `true` (or at least enable [`compilerOptions.noImplicitThis`](https://www.typescriptlang.org/tsconfig#noImplicitThis), which is a part of the `strict` flag) to leverage type checking of `this` in component options. Otherwise `this` will be treated as `any`.

Expand Down

0 comments on commit 32c0a6a

Please sign in to comment.