DEV Community

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

Posted on • Updated on

 

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

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.