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

Consistently style code blocks in tsconfig reference #3335

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These conditions are added to whatever existing conditions a resolver will use b

For example, when this field is set in a `tsconfig.json` as so:

```jsonc
```json tsconfig
{
"compilerOptions": {
"target": "es2022",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TypeScript's type acquisition can infer what types should be added based on file

You can disable this via `disableFilenameBasedTypeAcquisition`.

```json
```json tsconfig
{
"typeAcquisition": {
"disableFilenameBasedTypeAcquisition": true
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig-reference/copy/en/options/enable.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ oneline: "Disable the type acquisition for JavaScript projects."

Disables automatic type acquisition in JavaScript projects:

```json
```json tsconfig
{
"typeAcquisition": {
"enable": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ example

Using a `tsconfig.json` which has `explainFiles` set to true:

```json
```json tsconfig
{
"compilerOptions": {
"target": "es5",
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig-reference/copy/en/options/include.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ oneline: "Specify a list of glob patterns that match files to be included in com
Specifies an array of filenames or patterns to include in the program.
These filenames are resolved relative to the directory containing the `tsconfig.json` file.

```json
```json tsconfig
{
"include": ["src/**/*", "tests/**/*"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is called automatic type acquisition, and you can customize it using the `t

If you would like to disable or customize this feature, create a `jsconfig.json` in the root of your project:

```json
```json tsconfig
{
"typeAcquisition": {
"enable": false
Expand All @@ -18,7 +18,7 @@ If you would like to disable or customize this feature, create a `jsconfig.json`

If you have a specific module which should be included (but isn't in `node_modules`):

```json
```json tsconfig
{
"typeAcquisition": {
"include": ["jest"]
Expand All @@ -28,7 +28,7 @@ If you have a specific module which should be included (but isn't in `node_modul

If a module should not be automatically acquired, for example if the library is available in your `node_modules` but your team has agreed to not use it:

```json
```json tsconfig
{
"typeAcquisition": {
"exclude": ["jquery"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ oneline: "Specify a list of modules which to exclude from type acquisition."

Offers a config for disabling the type-acquisition for a certain module in JavaScript projects. This can be useful for projects which include other libraries in testing infrastructure which aren't needed in the main application.

```json
```json tsconfig
{
"typeAcquisition": {
"exclude": ["jest", "mocha"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If you have a JavaScript project where TypeScript needs additional guidance to u

You can use `include` to specify which types should be used from DefinitelyTyped:

```json
```json tsconfig
{
"typeAcquisition": {
"include": ["jquery"]
Expand Down
4 changes: 2 additions & 2 deletions packages/tsconfig-reference/copy/en/sections/buildOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Type Acquisition is only important for JavaScript projects. In TypeScript projec

You may not want this, in which case you can turn off type acquisition by having this `jsconfig.json` in the root of your project:

```json
```json tsconfig
{
"typeAcquisition": {
"enable": false
Expand All @@ -14,7 +14,7 @@ You may not want this, in which case you can turn off type acquisition by having

Common uses for this section of a `jsconfig.json` is to tell TypeScript to download additional definitions for your tooling experience:

```json
```json tsconfig
{
"typeAcquisition": {
"include": ["jquery"]
Expand Down