Linters have two categories of rules:

代码修正一般有两种规则:

Formatting rules: eg: max-lenno-mixed-spaces-and-tabskeyword-spacingcomma-style...

格式化规则,例如:最大长,不允许空格和tab混合,关键字的spacing,冒号风格...

Prettier alleviates the need for this whole category of rules! Prettier is going to reprint the entire program from scratch in a consistent way, so it's not possible for the programmer to make a mistake there anymore :)

prettier就是做这个的,prettier会将整个项目保持在一个统一的风格。

Code-quality rules: eg no-unused-varsno-extra-bindno-implicit-globalsprefer-promise-reject-errors...

Prettier does nothing to help with those kind of rules. They are also the most important ones provided by linters as they are likely to catch real bugs with your code!

代码质量规则,例如:不能有未使用的变量,不能有无意义的bind,不能隐式定义全局变量,不能在promise中reject()空值

prettier不管这些,这些是更适合交给linter(eslint) 来做的。

prettier 与 eslint 对比的更多相关文章

  1. vscode 中 eslint prettier 和 eslint -loader 配置关系

    前置 本文将探究 vscode prettier 插件 和 eslint 插件在 vscode 中的配置以及这两者对应的在项目中的配置文件的关系,最后提及 vscode eslint 插件配置与 es ...

  2. eslint prettier vetur eslint

    VScode (版本 1.47.3)安装 eslint prettier vetur 插件 .vue 文件使用 vetur 进行格式化 在文件 .prettierrc 里写 属于你的 pettier ...

  3. vscode, eslint, prettier, vetur冲突及解决

    这3工具都必须安装. 但是安装之后, 规则冲突又让人头疼. 讲下解决方案吧.一 从0开始1. 禁止工作区插件, 如下图:  2. 清空用户设置(Code–>首选项–>设置–>[右上角 ...

  4. 使用ESLint+Prettier来统一前端代码风格

    Prettier 简单使用 ESLint 与 Prettier配合使用 首先肯定是需要安装 prettier ,并且你的项目中已经使用了 ESLint ,有 eslintrc.js 配置文件. npm ...

  5. Vue2/3 项目中的 ESLint + Prettier 代码检测格式化风格指南

    Vue2/3 项目中的 ESLint + Prettier 代码检测格式化风格指南 因为平时都是使用 VSCode ESLint + Prettier 检测格式化不规范代码,但是随着接手的项目越来越多 ...

  6. 【前端必会】Prettier,有了ESlint,还要Prettier

    介绍 已经安装了ESLint为什么还要Prettier,主要是让ESLint专注于语法相关的验证,检查潜在问题.而代码格式化则有Prettier来接管 对比参考: https://baijiahao. ...

  7. 在vscode中使用eslint+prettier格式化vue项目代码 (转载)

    ESlint:javascript代码检测工具,可以配置每次保存时格式化js,但每次保存只格式化一点点,你得连续按住Ctrl+S好几次,才格式化好,自行体会~~ vetur:可以格式化html.标准c ...

  8. React-native ESLint & Prettier & Pre-commit Hook配置

    目录 前言 一 eslint 1.1. 局部安装eslint 1.2 初始化配置文件 1.3 安装步骤 1.3.1 ESLint 风格 选Use a popular style guide 1.3.2 ...

  9. 03.ElementUI源码学习:代码风格检查和格式化配置(ESlint & Prettier)

    书接上文.在团队协作中,为避免低级Bug.以及团队协作时不同代码风格对彼此造成的困扰与影响,会预先制定编码规范.使用 Lint工具和代码风格检测工具,则可以辅助编码规范执行,格式化代码,使样式与规则保 ...

随机推荐

  1. 流量监控---iftop

    一.iftop是什么? iftop是类似于top的实时流量监控工具. 官方网站:http://www.ex-parrot.com/~pdw/iftop/ 二.iftop有什么用? iftop可以用来监 ...

  2. Python笔记7----Pandas中变长字典Series

    1.Series概念 类似一维数组的对象,由数据和索引组成 2.Series创建 用Series()函数创建,0,1,2为series结构自带的索引. 可以自己指定索引值,用index,也可以直接用字 ...

  3. struct timeval和gettimeofday

    struct timeval和gettimeofday() struct timeval结构体在time.h中的定义为: struct timeval { time_t tv_sec; /* Seco ...

  4. MySQL数据库唯一性设置(unique index)

    1,命令行操作 分为两种.一种是在建表时就想好要加上唯一性,另一种是在后期才发现需要设置唯一性. 建表时: CREATE TABLE `t_user` ( `Id` int(11) NOT NULL ...

  5. Python 纸牌游戏

    纸牌游戏 # card.py from random import shuffle class Card: # 黑桃,红桃,方块,梅花 suits = ['spades', 'hearts', 'di ...

  6. Java基础学习总结(65)——Java中的String,StringBuilder和StringBuffer比较

    字符串,就是一系列字符的集合. Java里面提供了String,StringBuffer和StringBuilder三个类来封装字符串,其中StringBuilder类是到jdk 1.5才新增的.字符 ...

  7. 工具-Telerik trial安装图解

  8. 洛谷 1775. [国家集训队2010]小Z的袜子

    1775. [国家集训队2010]小Z的袜子 ★★★   输入文件:hose.in   输出文件:hose.out   简单对比时间限制:1 s   内存限制:512 MB [题目描述] 作为一个生活 ...

  9. [Azure][Windows Azure介绍]C1了解Windows Azure

    本章介绍了Windows Azure平台,并介绍了该平台提供的不同的服务和解决方案.本章主要针对还不熟悉什么Windows Azure是和它能做什么的读者.如果你已经熟悉了Windows Azure, ...

  10. Eclipse中高效的快捷键、调试及Junit

    Eclipse中高效的快捷键 当我知道了这些快捷键的用法之后,感觉真的非常兴奋,没想到Eclipse中还有这么多令人惊喜的功能,真的能够提高效率. 内容提示 Alt+/ 用于输入标准库或者keywor ...