当前位置:网站首页>vs code 使用 prettier 格式化 js 的时候, 函数定义的名称和括号之间有一个空格, 而 eslit 又不允许这个空格.
vs code 使用 prettier 格式化 js 的时候, 函数定义的名称和括号之间有一个空格, 而 eslit 又不允许这个空格.
2022-06-26 06:16:00 【草明】
vs code 使用 prettier 格式化 js 的时候, 函数定义的名称和括号之间有一个空格, 而 eslit 又不允许这个空格.

解决方法是使用 eslint 格式化, prettier 的配置也是可以生效的.
vs code 配置:
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
prettier 配置 (.prettierrc.json or .prettierrc):
{
"bracketSpacing": true,
"jsxBracketSameLine": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"semi": true
}
边栏推荐
- 打印数字的位信息
- Message queuing - omnidirectional comparison
- volatile应用场景
- numpy. frombuffer()
- Deeply uncover Ali (ant financial) technical interview process with preliminary preparation and learning direction
- 稀疏数组sparsearray
- "= =" difference from "equals"
- TCP connection and disconnection, detailed explanation of state transition diagram
- Tortoise and rabbit race example
- Ppt template crawler case
猜你喜欢

Zotero文献管理工具之Jasminum(茉莉花)插件

实时数仓方案如何选型和构建

Gof23 - builder mode

Getting started with Python

GoF23—建造者模式

Tencent WXG internship experience (has offered), I hope it will help you!

The interviewer with ByteDance threw me an interview question and said that if I could answer it, other companies would have an 80% chance of passing the technical level
![Selective search for object recognition paper notes [image object segmentation]](/img/cf/d3b08d41083f37c164b26a96b989c9.png)
Selective search for object recognition paper notes [image object segmentation]

消息队列-功能、性能、运维对比

Deeply uncover Ali (ant financial) technical interview process with preliminary preparation and learning direction
随机推荐
volatile应用场景
Gof23 - factory mode
EFK昇級到ClickHouse的日志存儲實戰
Gof23 - prototype mode
MVC source code sharing
Logstash——Logstash向Email发送告警邮件
Spark source code analysis (I): RDD collection data - partition data allocation
Redis底层数据结构
消息队列-消息事务管理对比
PyTorch使用多GPU并行训练及其原理和注意事项
GoF23—工厂模式
COW读写复制机制在Linux,Redis ,文件系统中的应用
ts中枚举类型(enum)简单使用
Deeply uncover Ali (ant financial) technical interview process with preliminary preparation and learning direction
Zotero文献管理工具之Jasminum(茉莉花)插件
Message queuing - omnidirectional comparison
Import / export function implementation
Library management system
NPM private server problem of peanut shell intranet penetration mapping
跨域的五种解决方案