Review main Merged

80943[TASK] Prune global TypeScript types

Benjamin Franzke CR +2 V +2 Hard +169 −116 updated 09/13/23, 11:14

Commit message

* Only define type definitions via "types"
  that need to be globally available.
  See  https://www.typescriptlang.org/tsconfig#types
  > If `types` is specified, only packages listed will
  > be included in the global scope

  Those whose exports are (and can be) imported locally
  are *not* included globally bot only explicitly via
  `import` by the typescript modules that make actually
  use of these dependencies.

* Move declarations from global into local scope that were
  actually only defined and used in specific files (draguploader)
  or move to inline code (disablePagingAction)
  or replace by modern code ($.escapeSelector => CSS.escape)

* Remove unnecessary `declare module` statements that
  shadowed type definitions that are avaiable right now:
  * This means muuri is now type checked, which revealed
    wrong usage in the dashboard grid and is fixed right away.

* Remove `any` where possible and use actual types instead

Left for later cleanups are:

* The ckeditor5-bundle should ideally be written in TypeScript
  to avoid the need for a handcrafted .d.ts file and the bundle
  itself would be compile time type-checked.

* chart.js flatpickr and shortcut-buttons-flatpickr usage should be
  adapted to allow their natively provided types to kick it, but that
  needs upstream fixes for shortcut-buttons-flatpickr first and we
  need to stop mapping flatpickr and chart.js to pseudo package names.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 26