I create a react-typescript project using create-react-app. I see that package.json looks like below:
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^24.9.1",
"@types/node": "^12.12.26",
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.1",
"typescript": "^3.7.5"
},
*
There is no dev-dependencies section and why it puts typescript (and @types) in dependencies section? Not only this, but official create-react-app page does install types/typescript without -D/save-dev flag. If consumers might depend on some types when they use my package as suggested by someone as a duplicate question, why this behavior is not default every where? What am i missing here? This wasn't mentioned anywhere in official docs. even typescript docs installs it as save-dev. https://www.typescriptlang.org/docs/handbook/react-&-webpack.html
* official link https://create-react-app.dev/docs/adding-typescript/