@wyw-in-js/shared produces /// <reference types="node" /> in @wyw-in-js/shared/types/options/types.d.ts
In its own turn @wyw-in-js/shared/types/options/types.d.ts gets imported by @wyw-in-js/shared/types/options/isFeatureEnabled.d.ts and then this by @wyw-in-js/shared/types/index.d.ts
This makes anything importing @wyw-in-js/shared automatically include all node.js specific type definitions even if it's a browser-facing project.
@linaria/core includes @wyw-in-js/shared so you can understand that this is a problem since @linaria/core is imported by all web-facing projects
Reproducible Demo
Install @linaria/core in project where nodejs modules are NOT included.
Import @linaria/core in a ts file.
Create a timer like const timerId: number = setTimeout(...)
tsc will fail with: TS2322: Type Timeout is not assignable to type number because nodejs types flooded the global scope.
If you don't include @linaria/core you don't get the error.
Environment
@wyw-in-js/shared
version:0.2.2
Description
@wyw-in-js/shared
produces/// <reference types="node" />
in@wyw-in-js/shared/types/options/types.d.ts
@wyw-in-js/shared/types/options/types.d.ts
gets imported by@wyw-in-js/shared/types/options/isFeatureEnabled.d.ts
and then this by@wyw-in-js/shared/types/index.d.ts
@wyw-in-js/shared
automatically include all node.js specific type definitions even if it's a browser-facing project.@linaria/core
includes@wyw-in-js/shared
so you can understand that this is a problem since@linaria/core
is imported by all web-facing projectsReproducible Demo
@linaria/core
in project wherenodejs
modules are NOT included.@linaria/core
in ats
file.const timerId: number = setTimeout(...)
tsc
will fail with:TS2322: Type Timeout is not assignable to type number
becausenodejs
types flooded the global scope.@linaria/core
you don't get the error.