ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.65k stars 3.71k forks source link

Support TypeScript v5.7+ in `ckeditor5-dev-build-tools` #17526

Open psmyrek opened 4 days ago

psmyrek commented 4 days ago

Provide a description of the task

TypeScript v5.7 has been released a few days ago with additional restrictions in JSON imports: https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/#validated-json-imports-in---module-nodenext.

The goal is to make the ckeditor5-dev-build-tools package compatible with this TypeScript version. Right now yarn run test fails in this package:

FAIL  tests/build/build.test.ts > TypeScript declarations
Error:
ERROR: Error occurred when processing the file undefined.
[plugin typescript] src/input.ts (7:22): @rollup/plugin-typescript TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'NodeNext'.
7 import settings from './settings.json';
                       ~~~~~~~~~~~~~~~~~

 ❯ Module.build src/build.ts:249:9
    247|   }
    248|
    249|   throw new Error( removeWhitespace( message ) );
       |         ^
    250|  }
    251| }
 ❯ tests/build/build.test.ts:107:21