hubmapconsortium / ccf-asct-reporter

HRA ASCT+B Reporter
https://hubmapconsortium.github.io/ccf-asct-reporter/
10 stars 5 forks source link

Remove 'any' types and specific return types throughout the Reporter and API #195

Open macvogelsang opened 3 years ago

macvogelsang commented 3 years ago

There are 457 cases of any type declarations and missing return types on functions. To have cleaner and more readable code, we should correct this problem and use stricter typing.

The following two eslint rules can be enabled to catch these problems in the linter: See L45 of .eslintrc

// Set the following two rules to "warn" or "error" to disallow 'any' types
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",

no-explicit-any docs explicit-module-boundary-types docs

macvogelsang commented 3 years ago

This issue might be too big and too much of chore for one person to do. We don't have models defined for many of the places where we use any types, and deciphering all of that code is a huge task. It would be nice if there is a way for us to run these linting rules on changed files only (or turn them into a SonarCloud rule). That way we can fix it one piece at a time over many iterations.