I just found out that this code:
const arr = [1, 2, 3, null]; // number[] or (number | null)[] ?
const arr = [1, 2, 3, undefined]; // number[] or (number | undefined)[] ?
gives different typings results in different projects, and i'm not sure why this would change.
However this seems okay:
const arr = [1, 2, 3, '4']; // (number | string)[]
In Stackblitz, number[]: https://stackblitz.com/edit/typescript-mxv8v6?file=index.ts
In TS Playground, (number | null)[]: https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgJwQOQK4Bt0wLwwNoCMANDAEwkDMJYG6AugNwBQoksiCAqmACYCmAMwCWYPjxz5iZSiVS9BIsYxbho8JAGUoCEQHMJhEuRhUYAcgAsZ5UA
This difference is also present in some of my projects, and i don't know what config would influence this.
Does anyone know ?