When trying to build the library locally or explicitly run tsc, a type error is reported:
pnpm tsc
src/index.ts:367:11 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
367 console.warn(`Property ${property} does not support negative values`);
~~~~~~~
Found 1 error in src/index.ts:367
This makes sense, as the type definitions for console would have to come from a platform-specific library. Some options I see are:
use Node bindings by adding @types/node (as I've done on my fork)
use DOM bindings by adding DOM to compilerOptions.lib in tsconfig.json
manually // @ts-expect-error (not ideal)
imo option 1 seems the easiest, though it does implicitly suggest that this library should be used primarily in a Node context rather than web (which afaik it technically should)
Happy to open a PR with whatever approach makes the most sense :)
When trying to build the library locally or explicitly run
tsc
, a type error is reported:This makes sense, as the type definitions for
console
would have to come from a platform-specific library. Some options I see are:@types/node
(as I've done on my fork)DOM
tocompilerOptions.lib
intsconfig.json
// @ts-expect-error
(not ideal)imo option 1 seems the easiest, though it does implicitly suggest that this library should be used primarily in a Node context rather than web (which afaik it technically should)
Happy to open a PR with whatever approach makes the most sense :)