Skip to content

Enable TypeScript

Erwan Rouchet requested to merge enable-ts into master

Closes #36 (closed)

I enabled TypeScript by running npx vue ui then just clicking around to add the TS plugin on Vue CLI, then I went through and updated a few files:

  • The ConfidenceTag is the first component to use <script lang="ts">.
  • The new ESLint rules also add a bunch of checks on JS files, causing most of the changes here, for example for unused variables.
  • I TSed a few helper files, and created a src/types.ts for types that will be common to many files.
  • I chose not to TS the unit tests at all, because the point of many of those tests is to check for proper handling of unexpected types at runtime. It appears having JS tests in TS projects is actually quite common from a random look around a few projects, including for Vue itself.

Merge request reports

Loading