Skip to content

Commit 9451652

Browse files
committed
fix code blocks
1 parent 88d01c1 commit 9451652

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

modules/10-basics/10-hello-world/en/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
As is tradition, we'll start by writing a 'Hello, World!' program. The program will print the following text:
33

4-
<pre class='hexlet-basics-output'>
5-
Hello, World!
6-
</pre>
4+
```text
5+
Hello, World!
6+
```
77

88
To print something, you need to give computer a special command. In TypeScript, we use console.log().
99

modules/10-basics/10-hello-world/ru/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
По традиции начнем с написания программы 'Hello, World!'. Эта программа будет выводить на экран текст:
22

3-
<pre class='hexlet-basics-output'>
4-
Hello, World!
5-
</pre>
3+
```text
4+
Hello, World!
5+
```
66

77
Чтобы вывести что-то на экран, нужно дать компьютеру специальную команду. В языке TypeScript такая команда — `console.log()`.
88

modules/10-basics/20-typescript-as-a-second-language/en/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ You should also have an understanding of data types, variables, conditional cons
55

66
Learning a second programming language is easier than learning a first one, so the structure of the material changes a lot. Here we review the basic constructs to quickly familiarize ourselves with the syntax. Then we move on to the tasks for which TypeScript is studied.
77

8-
In this tutorial, we'll learn what TypeScript is, as well as break down its features, installation, and getting it up and running.
8+
In this tutorial, we'll learn what TypeScript is, as well as break down its features, installation, and getting it up and running.
99

1010
## What is TypeScript
1111

@@ -57,18 +57,18 @@ sum(10n, 5);
5757

5858
Not only will the code above fail to run, but it will also fail to compile. The TypeScript compiler will stop execution and indicate a type mismatch error.
5959

60-
If we look at the function definition, we can see that we are facing almost the same JavaScript, except for the type description of input variables in the function.
60+
If we look at the function definition, we can see that we are facing almost the same JavaScript, except for the type description of input variables in the function.
6161
It says that parameters `a` and `b` have type `number`. The rest of the TypeScript code is annotated with types in much the same way. The type descriptions can be very complex in places, but the idea remains the same.
6262

63-
We cannot say unequivocally which approach is better - static or dynamic typing. It all depends on the specific situation, and successful projects can be written in different languages. Since we are studying TypeScript in this
63+
We cannot say unequivocally which approach is better - static or dynamic typing. It all depends on the specific situation, and successful projects can be written in different languages. Since we are studying TypeScript in this
6464
course, we will look at the peculiarities of working with it.
6565

6666
## TypeScript Features
6767

6868
TypeScript has become one of the most popular typed languages due to the following features:
6969

70-
* TypeScript is almost completely compatible with JavaScript in terms of features and types. Everything written in
71-
TypeScript is also available in JavaScript, and vice versa. TypeScript is called a superset of the JavaScript
70+
* TypeScript is almost completely compatible with JavaScript in terms of features and types. Everything written in
71+
TypeScript is also available in JavaScript, and vice versa. TypeScript is called a superset of the JavaScript
7272
language. Meaning that it is the same JavaScript + type description.
7373
* The TypeScript compiler turns TypeScript code into JavaScript code. That is, it removes type definitions from TypeScript code. This process is also known as **transpilation**.
7474
* The developer of TypeScript is Microsoft
@@ -80,7 +80,7 @@ Let's look at the last feature in more detail.
8080

8181
Strong typing is not related to static typing. It refers to the extent to which a language allows automatic type conversions. A static language can be weak, and vice versa.
8282

83-
For example, in JavaScript we can add a number to a string. When the language encounters such a construct, it will automatically perform a type conversion: `10 + 'one'`.
83+
For example, in JavaScript we can add a number to a string. When the language encounters such a construct, it will automatically perform a type conversion: `10 + 'one'`.
8484
TypeScript won't do that. It will generate an error: `The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type`.
8585

8686
Many dynamic languages are strongly typed. For example, Ruby and Python are among them. Strong typing only makes the language better and does not complicate the process of programming.
@@ -121,4 +121,4 @@ In this lesson, we learned about the TypeScript language. We learned that it is
121121

122122
It is impossible to say which language is better. It all depends on the specific task and features of the language.
123123

124-
We also learned about the features of TypeScript in this lesson, and we also learned how to install and run it.
124+
We also learned about the features of TypeScript in this lesson, and we also learned how to install and run it.

modules/10-basics/80-any/ru/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const result = words.reduce((acc, word) => {
5050

5151
Компилятор TypeScript такой код не пропустит. Он укажет, что объект, который находится в константе `initial`, не содержит ключей со строковым типом:
5252

53-
```
53+
```text
5454
No index signature with a parameter of type 'string' was found on type '{}'.
5555
4 acc[word] = Object.hasOwn(acc, word) ? acc[word] + 1 : 1;
5656
```

modules/25-types/25-literal-types/ru/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
В программировании встречаются ситуации, когда мы работаем с ограниченным набором значений какого-то типа, например, с определенными строками. В них могут входить справочные данные, статусы и так далее. Как мог бы выглядеть статус заказа:
33

4-
```
4+
```text
55
Created
66
Paid
77
Shipped

modules/50-objects/45-record/en/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `Key` key will accept all values from `K` by brute force. In turn, `K` is a
1313

1414
This kind of construction, where we do not additionally define any specific fields with dynamic keys, is quite common. The built-in Utility Types provide a ready solution for this - `Record<Keys, Type>`. This generalized type takes a key type as its first argument and a value type as its second. Inside, everything is organized similarly as in our `Context` type:
1515

16-
```
16+
```typescript
1717
type Rating = 0 | 1 | 2 | 3 | 4 | 5;
1818
type SongsRating = Record<string, Rating>;
1919

modules/50-objects/45-record/ru/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const runApp = <C extends Context<string, unknown>>(ctx: C) => {};
1313

1414
Подобная конструкция, когда мы не задаем дополнительно никаких специфичных полей с динамическими ключами, встречается довольно часто. Встроенные Utility Types предоставляют для этого готовое решение — `Record<Keys, Type>`. Этот обобщенный тип принимает первым аргументом тип ключа, а вторым — тип значения. Внутри все устроено схожим образом, как в нашем типе `Context`:
1515

16-
```
16+
```typescript
1717
type Rating = 0 | 1 | 2 | 3 | 4 | 5;
1818
type SongsRating = Record<string, Rating>;
1919

0 commit comments

Comments
 (0)