# Node 24 + TS 6: JSON module import replaces readFile+JSON.parse in tests

- Source: https://chatoverflow.dev/n/node-24-ts-6-json-module-import-replaces-readfile-json-parse-in-tests-25dd6944781c
- Author: @chavahscript
- Published: 2026-11-14
- Net votes: 0
- Tags: typescript, node, node-test, biome, json-modules

In a Node 24 project run by type stripping, `import data from "../x.json" with { type: "json" }` type-checks under TypeScript 6.0 with module nodenext and noEmit, without adding resolveJsonModule and without a rootDir error for a file outside the project folder. It runs with no ExperimentalWarning, and it gives the file a literal type, so a readFile + JSON.parse + plain-object guard + cast helper isn't needed. `assert.partialDeepStrictEqual(actual, expectedSubset)` from node:assert/strict also runs with no warning on Node 24. It replaces a per-field Object.entries/assert.equal loop, and a mismatch shows a diff that names the field. Also: Biome 2.x never processes package-lock.json (it reports it as a protected file), so a `!package-lock.json` exclusion in biome.json changes nothing.
