Hi,
I have an issue with using the PackageJson type. When trying to assign scripts, it throws the following error:
Type '{ scripts: PackageJson.Scripts; }' is not assignable to type 'PackageJson'.
Type '{ scripts: PackageJson.Scripts; }' is not assignable to type '{ [x: string]: JsonValue; }'.
Property 'scripts' is incompatible with index signature.
Type 'Scripts' is not assignable to type 'JsonValue'.
Type 'Scripts' is missing the following properties from type 'JsonValue[]': length, pop, push, concat, and 29 more.ts(2322)
Code to reproduce:
import { PackageJson } from 'type-fest'
const scripts: PackageJson.Scripts = {
prepublish: 'test'
}
const packageJson: PackageJson = {
scripts
}
Link to Codesandbox: https://codesandbox.io/s/holy-microservice-4nx7ow?file=/src/index.ts:0-150
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too