luomus / laji

Frontend for Finnish Biodiversity Information Facility (FinBIF) data portal laji.fi (and other *.laji.fi frontends)
MIT License
7 stars 0 forks source link

Stricter ts config #586

Open olzraiti opened 1 month ago

olzraiti commented 1 month ago

Stricter typing would have many benefits: less bugs since the code is constructed better, less null pointer errors, easier coding since the methods are properly typed.

Eventually the old code won't be any worse typed than it is now, and new code will have improved typings when we get the strict typing on.

All developers are committed to this. Everybody has their own day when they work on this for as long as want to.

Monday: @Blodir Tuesday: @rpulkka Wednesday: @aorin Thursday: @MLumme Friday: @olzraiti

Dev instructions:

  1. cp tsconfig{.app-strict,}.json # replace tsconfig with the strict config
  2. Run app with npm start
  3. grind
  4. goto step 3
  5. git checkout tsconfig.json to revert the tsconfig
  6. commit straight to development
olzraiti commented 1 month ago

4864 errors currently

olzraiti commented 1 month ago

We have to think what to do other projects than laji btw. Many of not all of them use the root tsonfig, and so we must either isolate the tsconfigs for all projects or make all projects strict.

olzraiti commented 1 month ago

The error count increased from 4864 to 5254 :)

Blodir commented 1 month ago

7a3ba8bea37784ebc0c1623dbb0c28c3d77bec7e https://github.com/luomus/laji/commit/51281dd4fa91c2c268ef0ed92913b08c70d49a6c (forgot to add the issue id to commit message)

Inevitably I ended up adding a couple of undefined checks rather than only type level changes...

aorin commented 1 month ago

9fa4491d19da3dce40308ea10d95dfca8073bdb4 aeac2073fc2f4259ed81cfd3819086983191187f (I also forgot to add the issue id to the commit message)

olzraiti commented 4 weeks ago

Error count is now 3281

olzraiti commented 3 weeks ago

Image down to 2899

olzraiti commented 2 weeks ago

Image

down to 2404

olzraiti commented 1 week ago

Image

down to 2024

olzraiti commented 14 minutes ago

Image down to 1470