Skip to content

Commit f2c8f5a

Browse files
committed
ignore deprecations differently
1 parent 8fbe5bd commit f2c8f5a

10 files changed

Lines changed: 1 addition & 16 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ Let's take a look at what happens when we compile the above function `greet` wit
352352
```ts twoslash
353353
// @showEmit
354354
// @target: es5
355-
// @ignoreDeprecations: 6.0
356355
function greet(person: string, date: Date) {
357356
console.log(`Hello ${person}, today is ${date.toDateString()}!`);
358357
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ export const twoPi = valueOfPi * 2;
393393
// @showEmit
394394
// @module: umd
395395
// @moduleResolution: node
396-
// @ignoreDeprecations: 6.0
397396
// @resolveJsonModule: false
398397
// @noErrors
399398
import { valueOfPi } from "./constants.js";

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ For example, without `allowSyntheticDefaultImports` as true:
2626
// @esModuleInterop: false
2727
// @filename: utilFunctions.js
2828
// @noImplicitAny: false
29-
// @ignoreDeprecations: 6.0
3029
const getStringLength = (str) => str.length;
3130

3231
module.exports = {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Without `downlevelIteration` enabled, a `for / of` loop on any object is downlev
2424

2525
```ts twoslash
2626
// @target: ES5
27-
// @ignoreDeprecations: 6.0
2827
// @showEmit
2928
const str = "Hello!";
3029
for (const s of str) {
@@ -41,7 +40,6 @@ If this implementation is missing, you'll fall back to index-based iteration.
4140

4241
```ts twoslash
4342
// @target: ES5
44-
// @ignoreDeprecations: 6.0
4543
// @downlevelIteration
4644
// @showEmit
4745
const str = "Hello!";
@@ -54,7 +52,6 @@ You can use [tslib](https://www.npmjs.com/package/tslib) via [`importHelpers`](#
5452

5553
```ts twoslash
5654
// @target: ES5
57-
// @ignoreDeprecations: 6.0
5855
// @downlevelIteration
5956
// @importHelpers
6057
// @showEmit

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ With `esModuleInterop` disabled:
3333
// @showEmit
3434
// @esModuleInterop: false
3535
// @module: commonjs
36-
// @ignoreDeprecations: 6.0
3736
import * as fs from "fs";
3837
import _ from "lodash";
3938

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Turning on [`downlevelIteration`](#downlevelIteration) and `importHelpers` is st
2424
```ts twoslash
2525
// @showEmit
2626
// @target: ES5
27-
// @ignoreDeprecations: 6.0
2827
// @downleveliteration
2928
export function fn(arr: number[]) {
3029
const arr2 = [1, ...arr];
@@ -36,7 +35,6 @@ Then turning on both [`downlevelIteration`](#downlevelIteration) and `importHelp
3635
```ts twoslash
3736
// @showEmit
3837
// @target: ES5
39-
// @ignoreDeprecations: 6.0
4038
// @downleveliteration
4139
// @importhelpers
4240
// @noErrors

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const twoPi = valueOfPi * 2;
3636
// @showEmit
3737
// @module: umd
3838
// @moduleResolution: node
39-
// @ignoreDeprecations: 6.0
4039
// @resolveJsonModule: false
4140
// @noErrors
4241
import { valueOfPi } from "./constants";
@@ -50,7 +49,6 @@ export const twoPi = valueOfPi * 2;
5049
// @showEmit
5150
// @module: amd
5251
// @moduleResolution: node
53-
// @ignoreDeprecations: 6.0
5452
// @noErrors
5553
import { valueOfPi } from "./constants";
5654

@@ -63,7 +61,6 @@ export const twoPi = valueOfPi * 2;
6361
// @showEmit
6462
// @module: system
6563
// @moduleResolution: node
66-
// @ignoreDeprecations: 6.0
6764
// @resolveJsonModule: false
6865
// @noErrors
6966
import { valueOfPi } from "./constants";
@@ -128,7 +125,6 @@ While it’s rare to need to mix imports and require calls in the same file, thi
128125
// @showEmit
129126
// @module: none
130127
// @moduleResolution: node
131-
// @ignoreDeprecations: 6.0
132128
// @resolveJsonModule: false
133129
// @noErrors
134130
import { valueOfPi } from "./constants";

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Which creates quite a lot of JavaScript:
1919
```ts twoslash
2020
// @showEmit
2121
// @target: ES5
22-
// @ignoreDeprecations: 6.0
2322
const getAPI = async (url: string) => {
2423
// Get API
2524
return {};
@@ -31,7 +30,6 @@ Which can be switched out with your own globals via this flag:
3130
```ts twoslash
3231
// @showEmit
3332
// @target: ES5
34-
// @ignoreDeprecations: 6.0
3533
// @noEmitHelpers
3634
const getAPI = async (url: string) => {
3735
// Get API

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Enabling the option allows importing JSON, and validating the types in that JSON
3030
// @resolveJsonModule
3131
// @module: commonjs
3232
// @moduleResolution: node
33-
// @ignoreDeprecations: 6.0
3433
// @filename: settings.json
3534
{
3635
"repo": "TypeScript",

packages/typescript-vfs/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ const defaultCompilerOptions = (ts: typeof import("typescript")): CompilerOption
477477
skipLibCheck: true,
478478
skipDefaultLibCheck: true,
479479
moduleResolution: ts.ModuleResolutionKind.Bundler,
480+
...(ts.versionMajorMinor && Number(ts.versionMajorMinor.split(".")[0]) >= 6 ? { ignoreDeprecations: "6.0" } : {}),
480481
}
481482
}
482483

0 commit comments

Comments
 (0)