Skip to content

Update using create-react-app

Lukas Möller requested to merge update-cra into staging

#83 (closed)

Initialized a new frontend using cra. Non-cra dependencies were copied by their package.json entry - this means that all other packages are upgraded as well although this mostly isn't reflected in their package.json entry as it mostly only specified a min version which still matches.

Changes that had to be made as a consequence of the update:

  • Add alt to all <img> tags
  • Switch from tslint to eslint + resolve issues between them → Change Dockerfile
  • Add types to conform to typescripts typing rules which are more strict. {} / object can be used in fewer cases. Initialization of class members is also required which meant that | undefined had to be introduced in some cases.
  • Usage of confirm is against aslant rules per default config. Currently prepended all lines with confirm with an ignore comment.
  • moment exports its main function as a default export: import * as moment from "moment"import moment from "moment".
  • ReactMarkdown exports its main component as a default export: import * as ReactMarkdown from "react-markdown"import ReactMarkdown from "react-markdown".
  • !36 (merged) is needed for strict key types.
  • forEach loop isn't allowed in some cases by the default eslint ruleset (Was replace with for (const a of b))
  • Renamed .prettierrc.prettierrc.json
  • Fixed CSP problem by overriding env variable during production compilation
Edited by Lukas Möller

Merge request reports

Loading