Skip to content
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

Remove all mentioned jsconfig #8818

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions src/content/docs/en/guides/imports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ import logoUrl from '../../assets/logo.png?url';

In this example, a developer would need to understand the tree relationship between `src/pages/about/company.astro`, `src/components/controls/Button.astro`, and `src/assets/logo.png`. And then, if the `company.astro` file were to be moved, these imports would also need to be updated.

You can add import aliases from either `tsconfig.json` or `jsconfig.json`.
You can add import aliases in `tsconfig.json`.

```json title="tsconfig.json" ins={5-6}
{
Expand All @@ -188,9 +188,6 @@ import logoUrl from '@assets/logo.png?url';
---
```

These aliases are also integrated automatically into [VS Code](https://code.visualstudio.com/docs/languages/jsconfig) and other editors.


## `Astro.glob()`

[`Astro.glob()`](/en/reference/api-reference/#astroglob) is a way to import many files at once.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ You can configure TypeScript to enforce type imports in your `tsconfig.json` fil

## Import Aliases

Astro supports [import aliases](/en/guides/imports/#aliases) that you define in your `tsconfig.json` & `jsconfig.json` `paths` configuration. [Read our guide](/en/guides/imports/#aliases) to learn more.
Astro supports [import aliases](/en/guides/imports/#aliases) that you define in your `tsconfig.json` `paths` configuration. [Read our guide](/en/guides/imports/#aliases) to learn more.


```astro title="src/pages/about/nate.astro" "@components" "@layouts"
Expand Down
4 changes: 1 addition & 3 deletions src/content/docs/en/guides/upgrade-to/v1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ In prior releases, these were configured with `snowpackPlugin` or `snowpackPlugi

### Aliasing

In Astro v0.21+, import aliases can be added from `tsconfig.json` or `jsconfig.json`.
In Astro v0.21+, import aliases can be added in `tsconfig.json`.

```json add={4-6}
{
Expand All @@ -592,8 +592,6 @@ In Astro v0.21+, import aliases can be added from `tsconfig.json` or `jsconfig.j
}
```

_These aliases are integrated automatically into [VSCode](https://code.visualstudio.com/docs/languages/jsconfig) and other editors._

### File Extensions in Imports

In Astro v0.21+, files need to be referenced by their actual extension, exactly as it is on disk. In this example, `Div.tsx` would need to be referenced as `Div.tsx`, not `Div.jsx`.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Specifies a different root directory to check. Uses the current working director

#### `--tsconfig <path-to-file>`

Specifies a `tsconfig.json` or `jsconfig.json` file to use manually. If not provided, Astro will attempt to find a config, or infer the project's config automatically.
Specifies a `tsconfig.json` file to use manually. If not provided, Astro will attempt to find a config, or infer the project's config automatically.

#### `--minimumFailingSeverity <error|warning|hint>`

Expand Down
Loading