DEV Community

Cover image for Creating vite vue ts template: Install prettier
Sardorbek Imomaliev
Sardorbek Imomaliev

Posted on • Edited on

1

Creating vite vue ts template: Install prettier

Install prettier and setup default config files

  1. Install prettier npm install --save-dev prettier
  2. Create prettier config file touch .prettierrc.js
  3. Edit .prettierrc.js to look like this.

    module.exports = {
      semi: false,
      singleQuote: true,
      trailingComma: 'es5',
    }
    
  4. Create prettier ignore file touch .prettierignore

  5. Edit .prettierignore to look like this.

    # Ignore artifacts:
    dist
    coverage
    
  6. Add "format": "prettier --write ." to "scripts" section in package.json

       "scripts": {
         ...,
    -    "serve": "vite preview"
    +    "serve": "vite preview",
    +    "format": "prettier --write ."
       },
    
  7. Run npm run format

  8. git add .

  9. git commit -m 'install prettier'

Links

Project

GitHub logo imomaliev / vue-ts

Vite + Vue + TypeScript template

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay