[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"等插件效果!十分强大!代码提示功能特别强悍! 插件地址:点击此处! 推荐 ...
随机推荐
- 如何利用 jQuery 修改 css 中带有 !important 的样式属性?
使用 jQuery 修改 css 中带有 !important 的样式属性 外部样式为: div.test { width:auto !important; overflow:auto !import ...
- Revit API过滤管道系统类型
管道只能通过PipeType过滤出来类型属性,只能是系统族的类型属性.管道实例过滤不能用族符号和族实例,要用Pipe using System; using System.Collections.Ge ...
- 在ASP.NET MVC中实现Select多选
我们知道,在ASP.NET MVC中实现多选Select的话,使用Html.ListBoxFor或Html.ListBox方法就可以.在实际应用中,到底该如何设计View Model, 控制器如何接收 ...
- JavaScript:回调模式(Callback Pattern)
函数就是对象,所以他们可以作为一个参数传递给其它函数: 当你将introduceBugs()作为一个参数传递给writeCode(),然后在某个时间点,writeCode()有可能执行(调用)intr ...
- Android App组件之Fragment说明和示例
Android App组件之Fragment说明和示例 1 Fragement介绍 Android从3.0开始引入Fragment,主要是为了支持更动态更灵活的界面设计. Fragment是activ ...
- 根据Request ID找到对应的Session信息
2018年3月15日 13:04 /* Formatted on 2018/3/15 13:04:45 (QP5 v5.256.13226.35538) */ --根据Request ID找到对应的S ...
- ASP.NET MVC:mvc pattern
There are three pieces to the MVC pattern: The model—The domain that your software is built around. ...
- bat调用TexturePacker更新SpriteSheet
一款游戏会用到很多图片资源,通常我们会使用TexturePacker工具进行图片的拼接.压缩,为了考虑性能问题,单个SpriteSheet的尺寸不会设置的太大(最大1024 * 1024),这样就可能 ...
- 趣谈Java变量的可见性问题
了解过多线程的我们,对synchorized,sleep和valatile都比较了解,但是当这三个名词和“Java变量得可见性”的话题联系在一起不知道大家是否还可以保持大脑清晰??? 最近看到一个关于 ...
- 通过泛型来简化findViewById
我们一般写findViewById都要加个强制转换,感觉很麻烦,现在你可以在你的BaseActivity中写入如下方法: @SuppressWarnings(“unchecked”) public f ...