Skip to content

Commit 65b3720

Browse files
committed
fix: satisfy lint
1 parent 00c0409 commit 65b3720

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

zh/release-notes/typescript-5.7.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ packages
339339
首先,任何 JSON 文件导入都需要包含 `type: "json"` 的导入属性。
340340

341341
```typescript
342-
import myConfig from "./myConfig.json";
342+
import myConfig from './myConfig.json';
343343
// ~~~~~~~~~~~~~~~~~
344344
// ❌ 错误:当 'module' 设置为 'NodeNext' 时,将 JSON 文件导入 ECMAScript 模块需要 'type: "json"' 导入属性。
345345

346-
import myConfig from "./myConfig.json" with { type: "json" };
346+
import myConfig from './myConfig.json' with { type: 'json' };
347347
// ^^^^^^^^^^^^^^^^
348348
// ✅ 这是可以的,因为我们提供了 `type: "json"`
349349
```
@@ -352,12 +352,12 @@ import myConfig from "./myConfig.json" with { type: "json" };
352352

353353
```typescript
354354
// ✅ 这是可以的:
355-
import myConfigA from "./myConfig.json" with { type: "json" };
355+
import myConfigA from './myConfig.json' with { type: 'json' };
356356
let version = myConfigA.version;
357357

358358
///////////
359359

360-
import * as myConfigB from "./myConfig.json" with { type: "json" };
360+
import * as myConfigB from './myConfig.json' with { type: 'json' };
361361

362362
// ❌ 这是不可以的:
363363
let version = myConfig.version;
@@ -420,7 +420,7 @@ error TS2345: Argument of type 'Buffer' is not assignable to parameter of type '
420420

421421
那么,您可能需要更新 `@types/node`
422422

423-
您可以在[ GitHub 上阅读有关此更改的具体内容](https://github.com/microsoft/TypeScript/pull/59417)
423+
您可以在[GitHub 上阅读有关此更改的具体内容](https://github.com/microsoft/TypeScript/pull/59417)
424424

425425
### 在类中使用非字面量方法名创建索引签名
426426

zh/release-notes/typescript-5.9.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export function drawButton(options: Options): void;
217217
这也包括 `UInt8Array` 的子类型,例如 Node.js 中的 `Buffer`
218218
因此,你将看到如下新错误消息:
219219

220-
```
220+
```txt
221221
error TS2345: Argument of type 'ArrayBufferLike' is not assignable to parameter of type 'BufferSource'.
222222
error TS2322: Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
223223
error TS2322: Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'.
@@ -228,7 +228,7 @@ error TS2345: Argument of type 'Buffer' is not assignable to parameter of type '
228228
如果你遇到 `Buffer` 相关问题,你可能首先需要检查是否使用了最新版本的 `@types/node` 包。
229229
这可能包括运行
230230

231-
```
231+
```sh
232232
npm update @types/node --save-dev
233233
```
234234

0 commit comments

Comments
 (0)