我对 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}
]
}
}