js-joda / js-joda

:clock2: Immutable date and time library for javascript
http://js-joda.github.io/js-joda/
Other
1.62k stars 116 forks source link

YearMonth is lacking toString() in type definition #725

Open fluidsonic opened 4 months ago

fluidsonic commented 4 months ago

In the TypeScript definitions:

When calling toString() on a YearMonth (which returns an ISO-representation), it causes a false-positive ESLint warning:

ESLint: 'YearMonth.of(2024, 1)' will evaluate to '[object Object]' when stringified.(@typescript-eslint/no-base-to-string)

image

(It might be worth double-checking all classes with a custom toString() implementation.)

pithu commented 4 months ago

Hi @fluidsonic, thanks for reporting, looks like its missing in typings https://github.com/js-joda/js-joda/blob/main/packages/core/typings/js-joda.d.ts#L1562.

We are open for PR's

SaichandChowdary commented 3 months ago

@pithu I'd like to work on this one, can you assign it to me.

pithu commented 3 months ago

Sure 👍 , could you please check if toString is missing at other places in typings

SaichandChowdary commented 3 months ago

PR - https://github.com/js-joda/js-joda/pull/727