Skip to content

Latest commit

 

History

History
76 lines (60 loc) · 1.84 KB

File metadata and controls

76 lines (60 loc) · 1.84 KB

About

Resources

Add TypeScript

For an existing Vue project, you can the TypeScript plugin

$ vue add typescript
...
✔  Successfully installed plugin: @vue/cli-plugin-typescript

Create a new project from scratch

This project was generated using the Vue CLI. You can follow these steps below.

Optionally install Vue CLI globally:

$ npm install -g @vue/cli

Create a new project - you can run this even if you don't have Vue installed.

$ npx vue create my-project-name

When I ran that, here are options I saw and chose to make this template project.

  • Packages - I only added TypeScript.
    ❯◉ Babel
    ◉ TypeScript
    ◯ Progressive Web App (PWA) Support
    ◯ Router
    ◯ Vuex
    ◯ CSS Pre-processors
    ◉ Linter / Formatter
    ◯ Unit Testing
    ◯ E2E Testing
    
  • Vue: 3
  • Babel: Yes

    Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JS

  • Class components: No
  • Linter / formatter: The first was the default but I like Prettier so chose that.
    ESLint with error prevention only
    ESLint + Airbnb config
    ESLint + Standard config
    ❯ ESLint + Prettier
    TSLint (deprecated)
    
  • Additional lint features:
    ❯◉ Lint on save
    ◯ Lint and fix on commit
    
  • Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
    ❯ In dedicated config files
    In package.json
    

The tool sets up a project that uses Yarn.