Summary
I've noticed that the typescript compiler is set up on the maximum strict settings for this project. That's a good practice when it comes to actually producing a build of this project! However, when it comes to doing development work on the node-sdk, it can be a pain especially when it comes to testing. Usually my code is in a WIP state while writing tests, yet the compiler is set to such a strict setting that having things like unused imports are enough to break the build. This forces me to have to prematurely clean up my code while still in a WIP state, usually having to comment out imports that are currently unused but will be used later on when I'm finished writing the new feature I'm working on.
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
There are definitely a few ways to fix this. I think we could have a separate tsconfig for the testing environment that's less strict. But I also think that we could just disable most of the compiler-level strictness overall. After all, we're also using linting tools that are supposed to catch these exact same errors without also breaking our unit tests. Currently the npm test script we have also runs both linters, so even if we do this the tests will still break and refuse to run without additional reconfiguration of the test script. Ideally the test script would only test functionality while lint script would only test code style/formatting.
Also this is definitely vaguely related to #32 in that both of these are annoyances in running tests.
Summary I've noticed that the typescript compiler is set up on the maximum strict settings for this project. That's a good practice when it comes to actually producing a build of this project! However, when it comes to doing development work on the node-sdk, it can be a pain especially when it comes to testing. Usually my code is in a WIP state while writing tests, yet the compiler is set to such a strict setting that having things like unused imports are enough to break the build. This forces me to have to prematurely clean up my code while still in a WIP state, usually having to comment out imports that are currently unused but will be used later on when I'm finished writing the new feature I'm working on.
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.) There are definitely a few ways to fix this. I think we could have a separate
tsconfig
for the testing environment that's less strict. But I also think that we could just disable most of the compiler-level strictness overall. After all, we're also using linting tools that are supposed to catch these exact same errors without also breaking our unit tests. Currently the npmtest
script we have also runs both linters, so even if we do this the tests will still break and refuse to run without additional reconfiguration of thetest
script. Ideally thetest
script would only test functionality whilelint
script would only test code style/formatting.Also this is definitely vaguely related to #32 in that both of these are annoyances in running tests.