formulahendry / formulahendry/vscode-code-runner

add shortcode full path without extension

Open
#1,033 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
351
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
when i running typescript file in ESM project, got failed because extension ts unknown (ERR_UNKNOWN_FILE_EXTENSION)

**Describe the solution you'd like**
the solution change extension `.ts` to `.js`

example config:
```json
{
"code-runner.executorMap": {
"javascript": "node -r dotenv/config",
"typescript": "node -r ts-node/register -r dotenv/config"
}
}
```

example default command:
```bash
node -r ts-node/register -r dotenv/config "d:\Repositories\source-posts\src\ci\check-other-ci.ts"
```

working command is:
```bash
node -r ts-node/register -r dotenv/config "d:\Repositories\source-posts\src\ci\check-other-ci.js"
```

so the solution is get the full file path without extension. for example:

let assume new shortcode is `$fullpathWithoutExtension`
```json
{
"code-runner.executorMap": {
"javascript": "node -r dotenv/config",
"typescript": "node -r ts-node/register -r dotenv/config $fullpathWithoutExtension.js"
}
}
```

please add shortcode full path without extension

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.