i understand that's a rookie question, but i failed to find an answer to it.
For making my tests easier I need to run small parts of my code and, after some search, I found the code runner extension for VsCode to do it. An example is the following:
import { getContractAddress } from './useContract';
const contractAddress = getContractAddress(1);
console.log({ contractAddress });
For some conceptual reason, this file is triggered hourly and changing that is tricky. So, I just need to test this 3 lines for checking the value that's returned.
I assumed this should be really easy but I'm always having errors
[Running] ts-node "/Users/guest/Documents/GitHub/frontend/src/tempCodeRunnerFile.ts" /opt/homebrew/lib/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^ TSError: тип Unable to compile TypeScript: src/tempCodeRunnerFile.ts(1,1): error TS1208: 'tempCodeRunnerFile.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
Can you explain how to configure coderunner to run ts? I found several stuff explaining it to JS, but nothing to TS. I admit I'm newbie in web dev and coderunner, so don't be afraid of over explain it.,
Thanks!