diff --git a/src/content/docs/en/guides/typescript.mdx b/src/content/docs/en/guides/typescript.mdx index 7d70a1d03b0fb..3530aa1a343f9 100644 --- a/src/content/docs/en/guides/typescript.mdx +++ b/src/content/docs/en/guides/typescript.mdx @@ -270,15 +270,15 @@ const { title } = Astro.props; To see type errors in your editor, please make sure that you have the [Astro VS Code extension](/en/editor-setup/) installed. Please note that the `astro start` and `astro build` commands will transpile the code with esbuild, but will not run any type checking. To prevent your code from building if it contains TypeScript errors, change your "build" script in `package.json` to the following: -```json title="package.json" del={2} ins={3} ins="astro check && tsc --noEmit && " +```json title="package.json" del={2} ins={3} ins="astro check &&" "scripts": { "build": "astro build", - "build": "astro check && tsc --noEmit && astro build", + "build": "astro check && astro build", }, ``` :::note -`astro check` only checks types within `.astro` files, and `tsc --noEmit` only checks types within `.ts` and `.tsx` files. To check types within Svelte and Vue files, you can use the [`svelte-check`](https://www.npmjs.com/package/svelte-check) and the [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) packages respectively. +`astro check` checks all the files included in your TypeScript project. To check types within Svelte and Vue files, you can use the [`svelte-check`](https://www.npmjs.com/package/svelte-check) and the [`vue-tsc`](https://www.npmjs.com/package/vue-tsc) packages respectively. ::: 📚 Read more about [`.ts` file imports](/en/guides/imports/#typescript) in Astro.