[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": ,
"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
[Tool] Enable Prettier in VSCode as Format on Save and add config files to gitingore的更多相关文章
- vs code的使用(一) Format On Paste/Format On Save/ Format On Type
很多经典的问题可以搜索出来,但是一些很小的问题网上却没有答案 (这是最令人发狂的,这么简单,网上居然连个相关的信息都没有给出) (就比如我想保存后自动格式化,但网上的大部分都是如何取消保存后自动格式化 ...
- eslint+prettier 的 VSCode配置项
{ "files.autoSave": "off", "editor.fontSize": 12, "terminal.integ ...
- Using Tensorflow SavedModel Format to Save and Do Predictions
We are now trying to deploy our Deep Learning model onto Google Cloud. It is required to use Google ...
- vscode 中 eslint prettier 和 eslint -loader 配置关系
前置 本文将探究 vscode prettier 插件 和 eslint 插件在 vscode 中的配置以及这两者对应的在项目中的配置文件的关系,最后提及 vscode eslint 插件配置与 es ...
- VSCode中使用vue项目ESlint验证配置
如果在一个大型项目中会有多个人一起去开发,为了使每个人写的代码格式都保持一致,就需要借助软件去帮我们保存文件的时候,自己格式化代码 解决办法:vscode软件下载一个ESLint,在到设置里面找到se ...
- vscode编辑器自定义配置
{ //删除文件确认 "explorer.confirmDelete": false, // 主题 "workbench.iconTheme": "v ...
- vscode编辑器
插件 Auto Close Tag 自动关闭标签 Auto Rename Tag 自动修改标签 Bracket Pair Colorizer 多层括号不同颜色显示 EditorConfig fo ...
- Vue2/3 项目中的 ESLint + Prettier 代码检测格式化风格指南
Vue2/3 项目中的 ESLint + Prettier 代码检测格式化风格指南 因为平时都是使用 VSCode ESLint + Prettier 检测格式化不规范代码,但是随着接手的项目越来越多 ...
- VSCode插件及用户设置
第一部分:插件 VSCode内置"emmet"插件,"convert to utf-8"等插件效果!十分强大!代码提示功能特别强悍! 插件地址:点击此处! 推荐 ...
随机推荐
- STM32F4 Timer simplified block diagram
Timers TIM1 and TIM8 use 16-bit counters and are the most complex timers of all timers included in t ...
- JTAG - Debug Cable Driver/Receiver
- Programming 2D Games 读书笔记(第三章)
示例一:DirectX Window Graphics类用于初始化Direct 3D 主流程: 仅需要粗体部分 try{ // Create Graphics object graphics = ...
- btrace-dtrace-for-java-ish
http://dtrace.org/blogs/ahl/2012/04/24/btrace-dtrace-for-java-ish/
- Revit API注册事件
start using Autodesk.Revit.DB.Events; //http://revit.haotui.com [Autodesk.Revit.Attributes.Transacti ...
- 基于设备树的TQ2440 DMA学习(3)—— DMA控制器驱动
作者 彭东林pengdonglin137@163.com 平台 TQ2440Linux-4.9 概述 上一篇直接操作DMA控制器实现了一个mem2mem的DMA传输,但是这样不符合linux driv ...
- transitionFromView方法的使用
transitionFromView方法的使用 效果 源码 // // ViewController.m // TransitionFromView // // Created by YouXianM ...
- 详细解读Volley(二)—— ImageRequest & Request简介
上篇文章我们讲到了如何用volley进行简单的网络请求,我们可以很容易的接受到string.JsonObjec类型的返回结果,之前的例子仅仅是一次请求,这里需要说明volley本身就是适合高并发的,所 ...
- 用ImageSwitcher实现显示图片(更改图片时有动画效果)
ImageView和ImageSwitcher都是用来显示图片的.只不过后者在更新显示的图片的时候可以有动画效果. 注意点: 1.ImageSwitcher初始化需要定义一个ViewFactory,该 ...
- 《Excel效率手册:早做完,不加班》
<Excel效率手册:早做完,不加班> 基本信息 作者: 陈锡卢 杨明辉 出版社:清华大学出版社 ISBN:9787302350743 上架时间:2014-5-8 出版日期:2014 ...