惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
V
V2EX
C
Check Point Blog
GbyAI
GbyAI
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
T
Troy Hunt's Blog
博客园 - Franky
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Security Blog
Microsoft Security Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
The Cloudflare Blog
S
SegmentFault 最新的问题
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
I
InfoQ
博客园 - 【当耐特】
NISL@THU
NISL@THU
A
About on SuperTechFans
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Scott Helme
Scott Helme
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Latest
Security Latest
V
Vulnerabilities – Threatpost
Security Archives - TechRepublic
Security Archives - TechRepublic
A
Arctic Wolf
Hacker News: Ask HN
Hacker News: Ask HN
N
News and Events Feed by Topic
IT之家
IT之家
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
大猫的无限游戏
大猫的无限游戏
S
Security Affairs
The Register - Security
The Register - Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 热门话题
T
Tor Project blog

Eson Wong's Blog

我为什么开发 AI 英语听力生成器:Im-Listening Playwright E2E 测试框架入门教程 如何使用 LlamaIndex 构建一个 RAG 检索系统 批评 Milvus 入门教程 怎么在网页中实现自动调整视频的清晰度 什么是检索增强生成(Retrieval-Augmented Generation)? Phonics 自然拼读常见规则 - 辅音字母的发音规律 ESP8266EX 自动下载电路 浅聊 esp8266 墨水屏 Todo List 制作教程 2023 年我买过的最好用的商品 转变自我的密码:《Atomic Habits》读后感 Phonics 自然拼读常见规则 - 音节和元音字母的发音规律 怎么用 Github Actions 部署 Next.js 项目到服务器 使用 v4l 采集摄像头 《微习惯》 - 读书笔记 在 iPad 使用 VS Code 写代码 在 Macbook 上运行 ChatGLM-6B
怎么解决 Prettier 和 ESLint 在 VSCode 里的冲突?
本文作者: Eson Wong · 2023-09-18 · via Eson Wong's Blog

怎么解决 Prettier 和 ESLint 在 VSCode 里的冲突?

Prettier 是一个代码格式化工具。ESLint 是一个代码检查工具,它可以检查你的代码是否遵循了规范。他们通常会在项目中一起使用。前端开发过程中,我们通常会使用 Prettier 和 ESLint 来保持代码的可读性和统一代码风格和规范。项目脚手架工具和代码编辑器都可以引入 Prettier 和 ESLint 工具。

Prettier 和 ESlint 配置不当,会导致代码格式化和代码检查的冲突。项目脚手架工具和代码编辑器的配置不统一也会导致格式自动修复的冲突。

下面是配制 Prettier 和 ESLint 的方法:

  1. 安装 eslint-config-prettier

    1
    yarn add --dev eslint-config-prettier
  2. 在 ESLint 配置文件中添加配置

    .eslintrc.json 文件中的 extends 的最后中添加 "prettier";

    1
    2
    3
    {
    "extends": ["eslint:recommended", "prettier"]
    }

这样 VSCode 使用 Prettier 插件来格式化代码就不会冲突了。