Skip to content

Commit 9622166

Browse files
authored
Remove mentions of ES3 from docs (#3222)
1 parent a0f9636 commit 9622166

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

packages/documentation/copy/en/handbook-v2/Basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ to
388388
Why did this happen?
389389

390390
Template strings are a feature from a version of ECMAScript called ECMAScript 2015 (a.k.a. ECMAScript 6, ES2015, ES6, etc. - _don't ask_).
391-
TypeScript has the ability to rewrite code from newer versions of ECMAScript to older ones such as ECMAScript 3 or ECMAScript 5 (a.k.a. ES3 and ES5).
391+
TypeScript has the ability to rewrite code from newer versions of ECMAScript to older ones such as ECMAScript 3 or ECMAScript 5 (a.k.a. ES5).
392392
This process of moving from a newer or "higher" version of ECMAScript down to an older or "lower" one is sometimes called _downleveling_.
393393

394-
By default TypeScript targets ES3, an extremely old version of ECMAScript.
394+
By default TypeScript targets ES5, an extremely old version of ECMAScript.
395395
We could have chosen something a little bit more recent by using the [`target`](/tsconfig#target) option.
396396
Running with `--target es2015` changes TypeScript to target ECMAScript 2015, meaning code should be able to run wherever ECMAScript 2015 is supported.
397397
So running `tsc --target es2015 hello.ts` gives us the following output:
@@ -403,7 +403,7 @@ function greet(person, date) {
403403
greet("Maddison", new Date());
404404
```
405405

406-
> While the default target is ES3, the great majority of current browsers support ES2015.
406+
> While the default target is ES5, the great majority of current browsers support ES2015.
407407
> Most developers can therefore safely specify ES2015 or above as a target, unless compatibility with certain ancient browsers is important.
408408
409409
## Strictness

packages/documentation/copy/en/project-config/Compiler Options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ tsc app.ts util.ts --target esnext --outfile index.js
824824
<td><code><a href='/tsconfig/#module'>--module</a></code></td>
825825
<td><p><code>none</code>, <code>commonjs</code>, <code>amd</code>, <code>umd</code>, <code>system</code>, <code>es6</code>/<code>es2015</code>, <code>es2020</code>, <code>es2022</code>, <code>esnext</code>, <code>node16</code>, <code>nodenext</code>, or <code>preserve</code></p>
826826
</td>
827-
<td><p><code>CommonJS</code> if <a href="#target"><code>target</code></a> is <code>ES3</code> or <code>ES5</code>; <code>ES6</code>/<code>ES2015</code> otherwise.</p>
827+
<td><p><code>CommonJS</code> if <a href="#target"><code>target</code></a> is <code>ES5</code>; <code>ES6</code>/<code>ES2015</code> otherwise.</p>
828828
</td>
829829
</tr>
830830
<tr class="option-description even"><td colspan="3">
@@ -1429,7 +1429,7 @@ tsc app.ts util.ts --target esnext --outfile index.js
14291429
<td><code><a href='/tsconfig/#target'>--target</a></code></td>
14301430
<td><p><code>es3</code>, <code>es5</code>, <code>es6</code>/<code>es2015</code>, <code>es2016</code>, <code>es2017</code>, <code>es2018</code>, <code>es2019</code>, <code>es2020</code>, <code>es2021</code>, <code>es2022</code>, <code>es2023</code>, or <code>esnext</code></p>
14311431
</td>
1432-
<td><p><code>ES3</code></p>
1432+
<td><p><code>ES5</code></p>
14331433
</td>
14341434
</tr>
14351435
<tr class="option-description odd"><td colspan="3">

packages/documentation/copy/en/reference/Iterators and Generators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ for (let pet of pets) {
7171

7272
### Code generation
7373

74-
#### Targeting ES5 and ES3
74+
#### Targeting ES5
7575

76-
When targeting an ES5 or ES3-compliant engine, iterators are only allowed on values of `Array` type.
76+
When targeting an ES5-compliant engine, iterators are only allowed on values of `Array` type.
7777
It is an error to use `for..of` loops on non-Array values, even if these non-Array values implement the `Symbol.iterator` property.
7878

7979
The compiler will generate a simple `for` loop for a `for..of` loop, for instance:

packages/tsconfig-reference/copy/en/options/lib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In TypeScript 4.5, lib files can be overridden by npm modules, find out more [in
1818

1919
| Name | Contents |
2020
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
21-
| `ES5` | Core definitions for all ES3 and ES5 functionality |
21+
| `ES5` | Core definitions for all ES5 functionality |
2222
| `ES2015` | Additional APIs available in ES2015 (also known as ES6) - `array.find`, `Promise`, `Proxy`, `Symbol`, `Map`, `Set`, `Reflect`, etc. |
2323
| `ES6` | Alias for "ES2015" |
2424
| `ES2016` | Additional APIs available in ES2016 - `array.include`, etc. |

packages/tsconfig-reference/scripts/schema/result/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@
563563
"target": {
564564
"description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",
565565
"type": "string",
566-
"default": "ES3",
566+
"default": "ES5",
567567
"anyOf": [
568568
{
569569
"enum": [

packages/tsconfig-reference/scripts/schema/vendor/base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@
545545
"target": {
546546
"description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",
547547
"type": "string",
548-
"default": "ES3",
548+
"default": "ES5",
549549
"anyOf": [
550550
{
551551
"enum": [

packages/tsconfig-reference/scripts/tsconfigRules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export const defaultsForOptions = {
232232
jsxFactory: "React.createElement",
233233
locale: "Platform specific.",
234234
module: [
235-
"`CommonJS` if [`target`](#target) is `ES3` or `ES5`;",
235+
"`CommonJS` if [`target`](#target) is `ES5`;",
236236
"`ES6`/`ES2015` otherwise.",
237237
],
238238
moduleResolution: [
@@ -260,7 +260,7 @@ export const defaultsForOptions = {
260260
useUnknownInCatchVariables: trueIf("strict"),
261261
strictPropertyInitialization: trueIf("strict"),
262262
strictNullChecks: trueIf("strict"),
263-
target: "ES3",
263+
target: "ES5",
264264
useDefineForClassFields: [
265265
"`true` if [`target`](#target) is `ES2022` or higher, including `ESNext`;",
266266
"`false` otherwise.",

0 commit comments

Comments
 (0)