Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.17 KB

File metadata and controls

28 lines (18 loc) · 1.17 KB
hide_title true
custom_edit_url
pagination_prev
pagination_next

Home > @rushstack/node-core-library > JsonNull

JsonNull type

The Rush Stack lint rules discourage usage of null<></>. However, JSON parsers always return JavaScript's null to keep the two syntaxes consistent. When creating interfaces that describe JSON structures, use JsonNull to avoid triggering the lint rule. Do not use JsonNull for any other purpose.

Signature:

export type JsonNull = null;

Remarks

If you are designing a new JSON file format, it's a good idea to avoid null entirely. In most cases there are better representations that convey more information about an item that is unknown, omitted, or disabled.

To understand why null is deprecated, please see the @rushstack/eslint-plugin documentation here:

https://www.npmjs.com/package/@rushstack/eslint-plugin#rushstackno-null