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

Move @types/react as dev dependency #128

Open
aweichandt-lm opened this issue May 8, 2023 · 3 comments
Open

Move @types/react as dev dependency #128

aweichandt-lm opened this issue May 8, 2023 · 3 comments

Comments

@aweichandt-lm
Copy link

As @types/react is set as dependency i'm having issues with typescript check on my react-native application.
Seems that, by adding the definition inside the dependencies instead of the devDependencies in simple-makrdown, after installing the package now @types/react becomes an active dependency on my project as well, and all react types start to apply globally on my tsc check.
Can you please move it do devDependency?

@Apexal
Copy link

Apexal commented May 15, 2023

I was able to solve this by using yarn resolutions/npm overrides in my package.json:

...
"resolutions": {
    "@types/react": "^16.9.46", // the version my codebase expects
    "@types/react-dom": "^16.9.8"
}
...

to ensure the types match my codebase.

@aweichandt-lm
Copy link
Author

@Apexal i will definitely check that.
But i believe my issue is slightly different. Before installing the package, those dependencies are tagged as dev dependencies, and TS check does not threat them as global types by default, which is the case after installing this package. Those dependencies switch from dev to normal, and TS includes them by default.
Maybe this can be solved by some customisation on the tsconfig file. But still, there is no need to have them as dependencies in this package IMO.

@zaraustra
Copy link

Bump
Would be nice not having to manage module versions in 2 places. One would expect to just use the lockfile for that.

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

No branches or pull requests

3 participants