[LayaAirIDE 2.0][LayaAir IDE 2.0 beta4] 使用 prettier 格式化 ts 插件问题
使用 typescript 来开发。我在使用 prettier 来格式化代码的时候, 会出现问题,重复出现一些代码块追加到文件到末尾上。
vs code 中没有这个问题
.prettierrc
{
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
setting.json
{
"prettier.semi": false, // 不加分号
"prettier.singleQuote": true, // 单引号
"editor.formatOnSave": true // prettier用的是系统默认的保存格式化
}
插件地址:
https://marketplace.visualstud ... scode
vs code 中没有这个问题
.prettierrc
{
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
setting.json
{
"prettier.semi": false, // 不加分号
"prettier.singleQuote": true, // 单引号
"editor.formatOnSave": true // prettier用的是系统默认的保存格式化
}
插件地址:
https://marketplace.visualstud ... scode
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
短大人
赞同来自:
ankye大华
赞同来自:
semmy
赞同来自:
.prettierrc配置:
{
"printWidth": 130,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always"
}
工作区设置也配置了:
{"editor.formatOnSave": true,
"prettier.printWidth": 130,
"prettier.tabWidth": 4,
"prettier.singleQuote": true,
"prettier.trailingComma": "all"
}