cancervariants / fusion-curation

MIT License
2 stars 0 forks source link

fix "compilerOptions", "include" in tsconfig.json #282

Open katiestahl opened 2 months ago

katiestahl commented 2 months ago

{ "compilerOptions": { "target": "es6", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "checkJs": true }, "include": [ "./src/**/*.ts", "global/ResponseModels.ts", "src/services/main.tsx" ] }

All/most of our typescript files in client are .tsx (not .ts), so our typescript code isn't getting properly verified/linted. It works, but since we're not actually verifying all of our frontend files, this defeats the purpose of using typescript and our linters. We need to change tsconfig.json to: { "compilerOptions": { "target": "es6", "baseUrl": "src", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "checkJs": true }, "include": ["src"] }

This way, all of the files will be properly checked. Additionally, this will fix #190 and allow absolute pathing for project modules.

However, making these changes breaks a LOT of things, so this ticket would be pretty hefty fixing all of the errors. I started doing this work a bit in the branch issue-190, but it's more than I have time to complete at the moment (therefore adding this issue to address at another time)