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

Using yarn vs npm with typescript docs #7493

Closed
wants to merge 1 commit into from

Conversation

CKGrafico
Copy link

@CKGrafico CKGrafico commented Aug 9, 2019

When we want to use other TypeScript version and we do:
npm install typescript@3.5.3 -D
But when we use new features like const casting microsoft/TypeScript#29510 it does not compile.
Instead of that if we use:
yarn add typescript@3.5.3
Everything works

When we want to use other TypeScript version and we do:
`npm install typescript@3.5.3 -D` 
But when we use new features like const casting microsoft/TypeScript#29510 it does not compile.
Instead of that if we use:
`yarn add typescript@3.5.2`
Everything works
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ianschmitz
Copy link
Contributor

Sorry @CKGrafico, it's not clear to me what this PR is addressing. yarn vs npm shouldn't affect whether you can use a specific feature of TypeScript. We also don't include typescript as a dependency of our packages. It is solely controlled by your application's package.json.

@CKGrafico
Copy link
Author

If I create a project using --typescript seems that is using an old version of typescript (maybe some dependency?)
You can test using this code.

function example() {
    return [1, 'test'] as const;
}

'as const' is available since 3.5.1 if I'm not wrong.
If you install typescript using npm is not using the versions intalled, I 've reproduced this twice but maybe is only happening in our environments

@neilbryson
Copy link
Contributor

We're using TypeScript with CRA + npm and it uses whatever version included in our devDependencies.

@stale
Copy link

stale bot commented Sep 27, 2019

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Sep 27, 2019
@CKGrafico CKGrafico closed this Sep 27, 2019
@lock lock bot locked and limited conversation to collaborators Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants