vscode-settings.json配置(prettier + eslint)

栏目: JavaScript · 发布时间: 7年前

内容简介:在项目根目录新建.vscode文件夹,文件夹中新建settings.json覆盖全局的setings.json文件,配置同上

command + p 搜索到settings.json文件,文件配置及注释如下

"workbench.iconTheme": "vscode-icons-mac",
  "editor.renderIndentGuides": false,
  "cSpell.ignoreWords": ["antd"],
  //编辑器失去焦点时自动保存更新后的文件
  "files.autoSave": "onFocusChange",
  "workbench.colorTheme": "Monokai",
  "git.confirmSync": false,
  "window.title": "${activeEditorLong}${separator}${rootName}",
  "window.zoomLevel": 0,
  "editor.fontSize": 14,
  //为了符合eslint的两个空格间隔原则
  "editor.tabSize": 2,
  // 文件头部注释
  "fileheader.Author": "niuchunling",
  "fileheader.LastModifiedBy": "niuchunling",
  //关闭编辑器默认代码检查,为了不跟eslint配置冲突
  "editor.formatOnSave": false,
  "javascript.format.enable": false,
  //eslint 格式化插件,保存时应用eslint规则自动格式化后保存
  "eslint.autoFixOnSave": true,
  "prettier.eslintIntegration": true,
  // 去掉代码结尾分号
  "prettier.semi": false,
  "git.path": "/usr/bin/git",
  "editor.fontFamily": "Microsoft YaHei,Menlo, Monaco, 'Courier New', monospace",
  "editor.fontWeight": "bold",
  "javascript.updateImportsOnFileMove.enabled": "never",
  "explorer.confirmDragAndDrop": false
}
复制代码

2、 设置项目自己的规则

在项目根目录新建.vscode文件夹,文件夹中新建settings.json覆盖全局的setings.json文件,配置同上

tips: 以上都是基于几个前提

  • 编辑器安装了Prettier - Code formatter 插件并启用
  • 项目配置了使用eslint
  • fileheader相关配置是安装了Document This插件

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Bandit Algorithms for Website Optimization

Bandit Algorithms for Website Optimization

John Myles White / O'Reilly Media / 2013-1-3 / USD 19.99

This book shows you how to run experiments on your website using A/B testing - and then takes you a huge step further by introducing you to bandit algorithms for website optimization. Author John Myle......一起来看看 《Bandit Algorithms for Website Optimization》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具