Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of strict #10

Closed
spmiller opened this issue Jun 13, 2022 · 5 comments · Fixed by #11
Closed

Incorrect use of strict #10

spmiller opened this issue Jun 13, 2022 · 5 comments · Fixed by #11

Comments

@spmiller
Copy link
Contributor

Hi there,

Many thanks for this library. We are attempting to use it to enable our adoption of swc and it has saved us a lot of time so far!

In convertTsConfig, we assign swc config from the tsconfig, setting properties where they don't exist.

The problem occurs when we merge the two configs together here. tsc's definition of strict is not the same as swc's definition, but we merge them as if they are the same.

I think a simple solution would be to remove the copying of the strict setting from the tsconfig, and only set it if passed in via the manually overridden config. Would you accept a PR that did this?

@songkeys
Copy link
Owner

Hi @spmiller ,

I reconfirmed the docs. You are right! Thank you so much for pointing out.

Would you accept a PR that did this?

A PR is very welcome!

spmiller added a commit to spmiller/tsconfig-to-swcconfig that referenced this issue Jun 13, 2022
tsconfig's definition of strict is different to swc's, so we shouldn't treat them as the same field.

Default swc strict mode to false. It can still be overridden by manual config if required.

Fixes songkeys#10.
@spmiller
Copy link
Contributor Author

Hi @songkeys, thanks for your quick response. I submitted #11 for this, please let me know if you any require further changes.

spmiller added a commit to spmiller/tsconfig-to-swcconfig that referenced this issue Jun 13, 2022
'false' is currently the default, but we want the default behaviour from swc so will leave it unset.

Fixes songkeys#10.
@spmiller
Copy link
Contributor Author

Hi @songkeys,

Sorry to bother you, but did the version that was published to NPM as 2.0.0 include this fix? The only change appears to be version number:

Common subdirectories: /tmp/v1/node_modules/tsconfig-to-swcconfig/dist and /tmp/v2/node_modules/tsconfig-to-swcconfig/dist
diff /tmp/v1/node_modules/tsconfig-to-swcconfig/package.json /tmp/v2/node_modules/tsconfig-to-swcconfig/package.json
3c3
<   "version": "1.5.0",
---
>   "version": "2.0.0",

@songkeys
Copy link
Owner

Hi @spmiller

I'm so sorry about this! I mis-published the wrong commit on my local machine. I just published v2.0.1 for the correct one. Thank you so much for pointing out.

I will publish in GitHub Actions in the future!

@spmiller
Copy link
Contributor Author

No problem, these things happen! Thanks for your quick fix 🙂

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 a pull request may close this issue.

2 participants