zoukankan      html  css  js  c++  java
  • [Tool] Enable Prettier in VSCode as Format on Save and add config files to gitingore

    First of all, install Prettier extension: "Pettier - Code formatter".

    The open the VSCode setting:

    cmd + ,

    Search for "format": and enable "Format On Save"

    Add .prettierrc file:

    {
      "tabWidth": 4,
      "semi": true,
      "singleQuote": true
    }

    Add .prettierignore file: 

    dist
    package-lock.json

    Also you might want to make sure Prettier use eslint rules as well, not just ingore eslint rules we already setup:

    install:

    npm install --save-dev eslint-config-prettier
    // .eslintrc
    
    {
      "extends": ["eslint:recommended", "prettier"]
    }

    Add both file into global gitignore:

    touch ~/.gitignore_global // create one if you don't have it
    
    vim ~/.gitignore_global // edit it
    
    //add 
    .prettierrc
    .prettierignore
    
    // Run
    git config --global core.excludesfile ~/.gitignore_global
  • 相关阅读:
    爬虫大作业
    作业
    新练习
    爬虫新练习
    最新操作
    小练习
    Hadoop综合大作业
    理解Mapreduce
    熟悉常用的HBase操作
    第三章 熟悉常用的HDFS操作
  • 原文地址:https://www.cnblogs.com/Answer1215/p/10719286.html
Copyright © 2011-2022 走看看