logdna / logdna-browser

A frontend browser logging and exception capturing library for LogDNA
MIT License
19 stars 14 forks source link

[2.0.3] `LogMessage` interface using `Boolean` vs `boolean` #33

Closed prescience-data closed 2 years ago

prescience-data commented 2 years ago

Noticed this then when casting my own copy of the LogMessage and HooksOption type until exported.

https://github.com/logdna/logdna-browser/blob/v2.0.3/src/logdna.d.ts#L65

When using @typescript-eslint/ban-types linting rule, the linter autofixes Boolean to boolean.

Because Boolean !== boolean, it causes:

TS2322: Type 'LogHooksOption' is not assignable to type 'HooksOption'.   
Types of property 'beforeSend' are incompatible. 
...        
Types of property 'disableStacktrace' are incompatible.               
Type 'Boolean | undefined' is not assignable to type 'boolean | undefined'.                 
Type 'Boolean' is not assignable to type 'boolean | undefined'.

Normally I would assume this is developer preference, but I note that all the historic types are cast as primitives eg https://github.com/logdna/logdna-browser/blob/v2.0.3/src/logdna.d.ts#L37 so I imagine this inconsistency was possibly due to linting not running in CI etc?

logdnabot commented 2 years ago

:tada: This issue has been resolved in version 2.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: