You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search Terms:
tsconfig + node_modules / compile third module
Tried solutions
set 'skipDefaultLibCheck', 'skipLibCheck', 'moduleResolution' fields in tsconfig.compilerOptions;
set 'exclude', 'include' fields in tsconfig;
Code
Given an example 3rd module viser(viserjs/viser) which are also written in TS. Its package.json defines types field guide tsc to reference 'src/index.ts' under its project root. The lib contains unused locals, unused parameters, implicit any (and we can even assume it contains some totally incorrect type assignments).
And the working project is written in strict mode, its compile configs have severely conflicts with the 3rd module which is written in loose mode. Are there any ways to compile them without error throwing?
Even though we can make tsc output compiled js files ignoring tsc errors, in create-react-app project, build by react-scripts-ts script, any compiling errors will be printed in the terminal and the dev page overlay.
importviserfrom'viser'// a loose checking lib// strict mode code below
Expected behavior:
The 3rd modules under node_modules are compiled in loose mode, not throw any errors. Our main
project is compiled in strict mode, throw conflicts with tsconfig rules.
Actual behavior:
Compiling throw errors.
The text was updated successfully, but these errors were encountered:
The 3rd party package is exposing its sources as output. that is wrong. it should be a .d.ts.
Exposing the sources of a package means you want every user to compiler and include that in their output. i.e. distributing code. in this case the errors are correct.
I suggest filing an issue against viser to use a .d.ts instead.
TypeScript Version: 2.8.1
Search Terms:
tsconfig + node_modules / compile third module
Tried solutions
set 'skipDefaultLibCheck', 'skipLibCheck', 'moduleResolution' fields in
tsconfig.compilerOptions
;set 'exclude', 'include' fields in
tsconfig
;Code
Given an example 3rd module
viser(viserjs/viser)
which are also written in TS. Its package.json definestypes
field guide tsc to reference 'src/index.ts' under its project root. The lib contains unused locals, unused parameters, implicit any (and we can even assume it contains some totally incorrect type assignments).And the working project is written in strict mode, its compile configs have severely conflicts with the 3rd module which is written in loose mode. Are there any ways to compile them without error throwing?
Even though we can make tsc output compiled js files ignoring tsc errors, in create-react-app project, build by react-scripts-ts script, any compiling errors will be printed in the terminal and the dev page overlay.
Expected behavior:
The 3rd modules under node_modules are compiled in loose mode, not throw any errors. Our main
project is compiled in strict mode, throw conflicts with tsconfig rules.
Actual behavior:
Compiling throw errors.
The text was updated successfully, but these errors were encountered: