Skip to content

Conversation

valentin-nemcev
Copy link

@valentin-nemcev valentin-nemcev commented Sep 1, 2023

Defaults for this option may be different between tsc and SWC, and explicit override in ts-node is ignored.

This prevents drop-in replacement of ts-node --swc in place of ts-node for cases when the value of useDefineForClassFields is important

Here is an example of the problem this PR is attempting to fix:

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2021",
    "useDefineForClassFields": false
  }
}
$ ts-node -pe 'new class { f?:any }'
{}

$ ts-node --swc -pe 'new class { f?:any }'
{ f: undefined } # but should be {}

Defaults for this option may be different between tsc and SWC, and explicit override in ts-node is ignored.

This prevents drop-in replacement of `ts-node --swc` in place of `ts-node` for cases when the value of `useDefineForClassFields` is important
@cspotcode cspotcode mentioned this pull request Sep 14, 2023
@cspotcode
Copy link
Collaborator

Fixed via #2062

@cspotcode cspotcode closed this Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants