我遇到了eslint + prettier的问题。出现了一些像这样的“换行符”:
var err = "jqxhr: " + jqxhr + ". Status: " + textStatus + ", " + error;
将通过工具进行美化,如下:
var err =
"jqxhr: " + jqxhr + ". Status: " + textStatus + ", " + error;
(https://gyazo.com/ef44b03a25292f5e6e156c3105ef7c3b)
如何防止这种行为?谢谢!
配置示例:
{
"root": true,
"extends": [
"prettier",
"prettier/standard"
],
"env": {
"browser": true,
"jquery": true
},
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error"
],
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"max-len": [
"error",
{"code": 120, "ignoreUrls": true}
]
}
}