chartjs / chartjs/chartjs-plugin-annotation

TypeScript: `xMin`, `xMax`, `yMin`, `yMax` should accept undefined value as Scriptable options return value

Open
#921 0 comments 0 reactions 0 assignees View on GitHub
types
Dominant language
JavaScript
Stars
623
Forks
377
PR merge metrics
No merged PRs in 30d

Description

The four options `xMin`, `xMax`, `yMin`, and `yMax` can accept an `undefined` value to indicate "growth to the chart boundary." Scriptable options for these four options also support an `undefined` value. However, TypeScript has incorrectly defined the types for these four options:

```ts
xMax?: Scriptable,
xMin?: Scriptable,
yMax?: Scriptable,
yMin?: Scriptable,
```

Using `(_, __) => undefined` should be a valid assignment, but currently, TypeScript raises a type error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.