So i'm working on a project that use React TypeScript.
the package.json
{
"version": "0.1.0",
"private": true,
"dependencies": {
///...
"react": "^16.8.6",
"react-scripts-ts": "3.1.0",
},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
},
"devDependencies": {
///...
"@types/react": "16.8.0",
"npm": "^6.10.0",
"typescript": "^3.5.2"
}
}
the tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom", "esnext"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"importHelpers": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
With just a npm install; npm start, it builds and compile on Windows normally, and runs using TSC @3.5.2. For Linux(Ubuntu) it run on TSC @3.7.5 and it gets syntax errors and fail to compile, even though on TSC @3.5.2 i get the same results like :
(80,67): Property 'email' does not exist on type '{}'.